From 5096cce610b1923f98e63fd37be046218f708449 Mon Sep 17 00:00:00 2001 From: ahuang11 Date: Fri, 30 Dec 2022 13:43:01 -0800 Subject: [PATCH 1/2] Undo async --- prefect_dbt/cli/configs/bigquery.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/prefect_dbt/cli/configs/bigquery.py b/prefect_dbt/cli/configs/bigquery.py index 2fe76e7..eb1a0b5 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 +from google.auth.transport.requests import Request + try: from typing import Literal except ImportError: @@ -115,7 +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["token"] = await self_copy.credentials.get_access_token() + request = Request() + google_credentials.refresh(request) + configs_json["token"] = google_credentials.token else: for key in ("refresh_token", "client_id", "client_secret", "token_uri"): configs_json[key] = getattr(google_credentials, key) From 9dd9b995dd08591ac5cfe2968e59a052b9a0bf45 Mon Sep 17 00:00:00 2001 From: ahuang11 Date: Fri, 30 Dec 2022 13:43:32 -0800 Subject: [PATCH 2/2] Remove async --- prefect_dbt/cli/configs/bigquery.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/prefect_dbt/cli/configs/bigquery.py b/prefect_dbt/cli/configs/bigquery.py index eb1a0b5..410b834 100644 --- a/prefect_dbt/cli/configs/bigquery.py +++ b/prefect_dbt/cli/configs/bigquery.py @@ -8,8 +8,6 @@ except ImportError: from typing_extensions import Literal -from prefect.utilities.asyncutils import sync_compatible - from prefect_dbt.cli.configs.base import MissingExtrasRequireError, TargetConfigs try: @@ -88,8 +86,7 @@ class BigQueryTargetConfigs(TargetConfigs): project: Optional[str] = None credentials: GcpCredentials - @sync_compatible - async def get_configs(self) -> Dict[str, Any]: + def get_configs(self) -> Dict[str, Any]: """ Returns the dbt configs specific to BigQuery profile.