def __init__(self, project_id, credential_path):
self.credential_path = credential_path
self.project_id = project_id
scopes = ['https://www.googleapis.com/auth/bigquery']
credentials = ServiceAccountCredentials.from_json_keyfile_name(
credential_path, scopes)
http_auth = credentials.authorize(Http())
bigquery = build('bigquery', 'v2', http=http_auth)
self.bigquery = bigquery
评论列表
文章目录