Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass the default scopes to the default BigQuery credentials #3041

Merged
merged 1 commit into from Mar 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions plugins/bigquery/dbt/adapters/bigquery/connections.py
Expand Up @@ -48,14 +48,14 @@


@lru_cache()
def get_bigquery_defaults() -> Tuple[Any, Optional[str]]:
def get_bigquery_defaults(scopes=None) -> Tuple[Any, Optional[str]]:
"""
Returns (credentials, project_id)

project_id is returned available from the environment; otherwise None
"""
# Cached, because the underlying implementation shells out, taking ~1s
return google.auth.default()
return google.auth.default(scopes=scopes)


class Priority(StrEnum):
Expand Down Expand Up @@ -201,7 +201,7 @@ def get_bigquery_credentials(cls, profile_credentials):
creds = GoogleServiceAccountCredentials.Credentials

if method == BigQueryConnectionMethod.OAUTH:
credentials, _ = get_bigquery_defaults()
credentials, _ = get_bigquery_defaults(scopes=cls.SCOPE)
return credentials

elif method == BigQueryConnectionMethod.SERVICE_ACCOUNT:
Expand Down