Skip to content

Commit

Permalink
escaped table names while dedup (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
vrumjantsev authored Feb 12, 2024
1 parent d623e15 commit 5ee673f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion target_bigquery/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ def clean_up(self) -> None:
tmp = f"{self.merge_target.name}__tmp"
dedupe_query = (
f"SELECT * FROM {self.table.get_escaped_name()} "
f"QUALIFY ROW_NUMBER() OVER (PARTITION BY {', '.join(self.key_properties)} "
f"QUALIFY ROW_NUMBER() OVER (PARTITION BY {', '.join(f'`{p}`' for p in self.key_properties)} "
f"ORDER BY COALESCE({', '.join(date_columns)}) DESC) = 1"
)
ctas_tmp = f"CREATE OR REPLACE TEMP TABLE `{tmp}` AS {dedupe_query}"
Expand Down

0 comments on commit 5ee673f

Please sign in to comment.