mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
fix(sql): quote identifiers in transpile_to_dialect to fix case-sensitive column filters (#39521)
This commit is contained in:
@@ -1568,6 +1568,7 @@ def transpile_to_dialect(
|
||||
sql: str,
|
||||
target_engine: str,
|
||||
source_engine: str | None = None,
|
||||
identify: bool = False,
|
||||
) -> str:
|
||||
"""
|
||||
Transpile SQL from one database dialect to another using SQLGlot.
|
||||
@@ -1576,6 +1577,7 @@ def transpile_to_dialect(
|
||||
sql: The SQL query to transpile
|
||||
target_engine: The target database engine (e.g., "mysql", "postgresql")
|
||||
source_engine: The source database engine. If None, uses generic SQL dialect.
|
||||
identify: If True, quote all identifiers per the target dialect.
|
||||
|
||||
Returns:
|
||||
The transpiled SQL string
|
||||
@@ -1598,6 +1600,7 @@ def transpile_to_dialect(
|
||||
copy=True,
|
||||
comments=False,
|
||||
pretty=False,
|
||||
identify=identify,
|
||||
)
|
||||
except ParseError as ex:
|
||||
raise QueryClauseValidationException(f"Cannot parse SQL clause: {sql}") from ex
|
||||
|
||||
Reference in New Issue
Block a user