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

Undo async #111

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions prefect_dbt/cli/configs/bigquery.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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)
Expand Down