Skip to content

Commit

Permalink
fix: BigQuery SQL backticks
Browse files Browse the repository at this point in the history
  • Loading branch information
gouline committed Dec 20, 2024
1 parent d6a4247 commit 4d0df3a
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 4d0df3a

Please sign in to comment.