Skip to content

Commit

Permalink
fix: BigQuery SQL backticks (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
gouline authored Dec 20, 2024
1 parent d6a4247 commit 88452f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dbtmetabase/_exposures.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ def __extract_card_exposures(self, ctx: __Context, card: Mapping) -> Mapping:

# Parse SQL for exposures through FROM or JOIN clauses
for sql_ref in re.findall(_EXPOSURE_PARSER, native_query):
sql_ref = sql_ref.strip("`") # BigQuery uses backticks `dataset.table`

# DATABASE.schema.table -> [database, schema, table]
parsed_model_path = [s.strip('"').lower() for s in sql_ref.split(".")]

Expand Down

0 comments on commit 88452f1

Please sign in to comment.