From d60c028c131294d6e7bf4f62d6629da238263e6f Mon Sep 17 00:00:00 2001 From: fregosi lucien Date: Tue, 6 Dec 2022 12:53:28 +0100 Subject: [PATCH] fix compute engine credentials method --- prefect_dbt/cli/configs/bigquery.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/prefect_dbt/cli/configs/bigquery.py b/prefect_dbt/cli/configs/bigquery.py index b1760fb..2924966 100644 --- a/prefect_dbt/cli/configs/bigquery.py +++ b/prefect_dbt/cli/configs/bigquery.py @@ -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: @@ -111,6 +113,9 @@ 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"):