Skip to content

Commit 5b3e2af

Browse files
fix: Ensure table name is quoted in merge statement
1 parent 156034a commit 5b3e2af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: target_snowflake/connector.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from snowflake.sqlalchemy import URL
1313
from snowflake.sqlalchemy.base import SnowflakeIdentifierPreparer
1414
from snowflake.sqlalchemy.snowdialect import SnowflakeDialect
15-
from sqlalchemy.sql import text
15+
from sqlalchemy.sql import quoted_name, text
1616

1717
from target_snowflake.snowflake_types import NUMBER, TIMESTAMP_NTZ, VARIANT
1818

@@ -388,7 +388,7 @@ def _get_merge_from_stage_statement( # noqa: ANN202
388388
dedup = f"QUALIFY ROW_NUMBER() OVER (PARTITION BY {dedup_cols} ORDER BY SEQ8() DESC) = 1"
389389
return (
390390
text(
391-
f"merge into {full_table_name} d using " # noqa: ISC003
391+
f"merge into {quoted_name(full_table_name, quote=True)} d using " # noqa: ISC003
392392
+ f"(select {json_casting_selects} from '@~/target-snowflake/{sync_id}'" # noqa: S608
393393
+ f"(file_format => {file_format}) {dedup}) s "
394394
+ f"on {join_expr} "

0 commit comments

Comments
 (0)