Skip to content

Commit

Permalink
patch for --show with json
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-winkler committed Oct 21, 2023
1 parent bfc5dc4 commit 9b93327
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20231021-154237.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Patch for json inline --show
time: 2023-10-21T15:42:37.406853-06:00
custom:
Author: [email protected]
Issue: "972"
11 changes: 10 additions & 1 deletion dbt/adapters/bigquery/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import google.auth
import google.auth.exceptions
import google.cloud.bigquery
import google.cloud.bigquery as bigquery
import google.cloud.exceptions
from google.api_core import retry, client_info
from google.auth import impersonated_credentials
Expand Down Expand Up @@ -63,6 +63,15 @@
)


# Override broken json deserializer for dbt show --inline
def _json_from_json(value, _):
"""NOOP string -> string coercion"""
return json.loads(value)


bigquery._helpers._CELLDATA_FROM_JSON["JSON"] = _json_from_json


@lru_cache()
def get_bigquery_defaults(scopes=None) -> Tuple[Any, Optional[str]]:
"""
Expand Down

0 comments on commit 9b93327

Please sign in to comment.