Commit 28e1b55b authored by giomerlin's avatar giomerlin Committed by Tao Feng

fix: Use the right scope when getting the bigquery table usage (#181)

parent 142600c0
...@@ -44,15 +44,15 @@ class BaseBigQueryExtractor(Extractor): ...@@ -44,15 +44,15 @@ class BaseBigQueryExtractor(Extractor):
if self.key_path: if self.key_path:
credentials = ( credentials = (
google.oauth2.service_account.Credentials.from_service_account_file( google.oauth2.service_account.Credentials.from_service_account_file(
self.key_path, scopes=BaseBigQueryExtractor._DEFAULT_SCOPES)) self.key_path, scopes=self._DEFAULT_SCOPES))
else: else:
if self.cred_key: if self.cred_key:
service_account_info = json.loads(self.cred_key) service_account_info = json.loads(self.cred_key)
credentials = ( credentials = (
google.oauth2.service_account.Credentials.from_service_account_info( google.oauth2.service_account.Credentials.from_service_account_info(
service_account_info, scopes=BaseBigQueryExtractor._DEFAULT_SCOPES)) service_account_info, scopes=self._DEFAULT_SCOPES))
else: else:
credentials, _ = google.auth.default(scopes=BaseBigQueryExtractor._DEFAULT_SCOPES) credentials, _ = google.auth.default(scopes=self._DEFAULT_SCOPES)
http = httplib2.Http() http = httplib2.Http()
authed_http = google_auth_httplib2.AuthorizedHttp(credentials, http=http) authed_http = google_auth_httplib2.AuthorizedHttp(credentials, http=http)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment