mirror of
https://github.com/apache/superset.git
synced 2026-05-08 01:15:46 +00:00
fix(firebolt): allow backslach escape for single quotes (#32350)
(cherry picked from commit 22fe985cfc)
This commit is contained in:
committed by
Michael S. Molina
parent
7ef38fed24
commit
3eda2223ca
@@ -1164,3 +1164,24 @@ def test_firebolt_old() -> None:
|
||||
*
|
||||
FROM t1 UNNEST(col1 AS foo)"""
|
||||
)
|
||||
|
||||
|
||||
def test_firebolt_old_escape_string() -> None:
|
||||
"""
|
||||
Test the dialect for the old Firebolt syntax.
|
||||
"""
|
||||
from superset.sql.dialects import FireboltOld
|
||||
from superset.sql.parse import SQLGLOT_DIALECTS
|
||||
|
||||
SQLGLOT_DIALECTS["firebolt"] = FireboltOld
|
||||
|
||||
# both '' and \' are valid escape sequences
|
||||
sql = r"SELECT 'foo''bar', 'foo\'bar'"
|
||||
|
||||
# but they normalize to ''
|
||||
assert (
|
||||
SQLStatement(sql, "firebolt").format()
|
||||
== """SELECT
|
||||
'foo''bar',
|
||||
'foo''bar'"""
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user