diff --git a/prefect_dbt/cli/configs/bigquery.py b/prefect_dbt/cli/configs/bigquery.py index 2fe76e7..410b834 100644 --- a/prefect_dbt/cli/configs/bigquery.py +++ b/prefect_dbt/cli/configs/bigquery.py @@ -1,13 +1,13 @@ """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: from typing_extensions import Literal -from prefect.utilities.asyncutils import sync_compatible - from prefect_dbt.cli.configs.base import MissingExtrasRequireError, TargetConfigs try: @@ -86,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. @@ -115,7 +114,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)