From 045539795f358cfe64bf58246b2efa7f028953f2 Mon Sep 17 00:00:00 2001 From: Paolo Quadri Date: Tue, 8 Oct 2024 09:52:31 +0200 Subject: [PATCH] fix: always quote partition by (#15) --- snowflake_utils/models/table.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snowflake_utils/models/table.py b/snowflake_utils/models/table.py index 0dae23f..be2841d 100644 --- a/snowflake_utils/models/table.py +++ b/snowflake_utils/models/table.py @@ -285,9 +285,9 @@ def qualify( primary_keys: list[str], replication_keys: list[str] | None, ) -> None: - qualify_partition = ",".join(primary_keys) + qualify_partition = ",".join(f'"{c.upper()}"' for c in primary_keys) qualify_order = ",".join( - f"{c} desc" for c in (replication_keys or primary_keys) + f'"{c.upper()}" desc' for c in (replication_keys or primary_keys) ) logging.debug( f"Adding QUALIFY to table {self.fqn} on PARTITION {qualify_partition} ORDERED BY {qualify_order}"