From 736719c8d55f7d94b13d83e3e8deefca7c5d9ab1 Mon Sep 17 00:00:00 2001 From: hirenkumar-n-dholariya Date: Fri, 10 Apr 2026 18:51:22 -0400 Subject: [PATCH] fix(athena): quote schema/database in table prefix to support hyphenated names (#2483) Database and schema names in AWS Athena can contain hyphen (-) characters. Without quoting, these names are misinterpreted by the SQL query engine, causing query failures. The _create_table_prefix() method was returning self.schema unquoted, which meant any schema or database name with special characters like hyphens would produce invalid SQL. Fix: wrap the schema in double quotes in _create_table_prefix() so the generated SQL becomes: SELECT * FROM "my-schema".my_table Fixes #2483 --- soda/core/soda/execution/data_source.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/soda/core/soda/execution/data_source.py b/soda/core/soda/execution/data_source.py index e390daefa..56a3de622 100644 --- a/soda/core/soda/execution/data_source.py +++ b/soda/core/soda/execution/data_source.py @@ -1119,7 +1119,9 @@ def _create_table_prefix(self): return self.database return f'"{self.database}"."{self.schema}"' """ - return self.schema + if self.schema: + return f'"{self.schema}"' + return None def update_schema(self, schema_name): self.schema = schema_name