Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
fix compute engine credentials method (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucienfregosibodyguard authored and ahuang11 committed Dec 9, 2022
1 parent 57e61c8 commit 1ec321a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions prefect_dbt/cli/configs/bigquery.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""Module containing models for BigQuery configs"""
from typing import Any, Dict, Optional

import google

try:
from typing import Literal
except ImportError:
Expand Down Expand Up @@ -115,6 +117,9 @@ async def get_configs(self) -> Dict[str, Any]:
self_copy.credentials.get_credentials_from_service_account()
)
if hasattr(google_credentials, "token"):
configs_json["method"] = "oauth-secrets"
request = google.auth.transport.requests.Request()
google_credentials.refresh(request)
configs_json["token"] = google_credentials.token
else:
for key in ("refresh_token", "client_id", "client_secret", "token_uri"):
Expand Down

0 comments on commit 1ec321a

Please sign in to comment.