Skip to content

Commit a3a3581

Browse files
committed
Wrap each identifier part in double quotes for standard SQL compatibility
1 parent 2734f78 commit a3a3581

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

elementary/monitor/data_monitoring/data_monitoring.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,12 @@ def get_elementary_database_and_schema(self):
7979
relation = self.internal_dbt_runner.run_operation(
8080
"elementary_cli.get_elementary_database_and_schema", quiet=True
8181
)[0]
82-
# Replace double quotes with backticks for proper SQL compatibility
83-
relation = relation.replace('"', "`") if relation else relation
82+
# Split on dot and wrap each part in double quotes for standard SQL compatibility
83+
if relation and "." in relation:
84+
db, schema = relation.split(".", 1)
85+
relation = f'"{db}"."{schema}"'
86+
elif relation:
87+
relation = f'"{relation}"'
8488
logger.info(f"Elementary's database and schema: '{relation}'")
8589
return relation
8690
except Exception as ex:

0 commit comments

Comments
 (0)