You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/08/03 23:04:31 UTC
(superset) branch tdd/issue-39328-hana-placeholder-casing created (now 1e412c2bfe2)
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a change to branch tdd/issue-39328-hana-placeholder-casing
in repository https://gitbox.apache.org/repos/asf/superset.git
at 1e412c2bfe2 test(sql): pin HANA PLACEHOLDER query identifier casing round-trip (#39328)
This branch includes the following new commits:
new 1e412c2bfe2 test(sql): pin HANA PLACEHOLDER query identifier casing round-trip (#39328)
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(superset) 01/01: test(sql): pin HANA PLACEHOLDER query identifier casing round-trip (#39328)
Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch tdd/issue-39328-hana-placeholder-casing
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 1e412c2bfe2908b29e80cbd8e59ad85546cac7b3
Author: Claude Code <no...@anthropic.com>
AuthorDate: Mon Aug 3 16:03:25 2026 -0700
test(sql): pin HANA PLACEHOLDER query identifier casing round-trip (#39328)
HANA is mapped to the Postgres sqlglot dialect, and Postgres's generator
uppercases quoted identifiers that mix case, e.g. "zbw.10_001/INVENTORY"
becomes "ZBW.10_001/INVENTORY". HANA's calculation-view table names are
case-sensitive, so the re-cased identifier no longer resolves and SQL Lab
fails with "invalid table name" even though the original query was valid.
Confirmed red: SQLStatement(sql, engine="hana").format() reproduces the
exact uppercasing dosubot's triage comment described.
---
tests/unit_tests/sql/parse_tests.py | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/tests/unit_tests/sql/parse_tests.py b/tests/unit_tests/sql/parse_tests.py
index bec1849a196..f2f74aef108 100644
--- a/tests/unit_tests/sql/parse_tests.py
+++ b/tests/unit_tests/sql/parse_tests.py
@@ -503,6 +503,32 @@ def test_format_oracle_group_by_keeps_explicit_expressions_subquery() -> None:
assert not any(item.isdigit() for item in group_by_items)
+def test_format_hana_preserves_quoted_identifier_casing() -> None:
+ """
+ Regression test for https://github.com/apache/superset/issues/39328.
+
+ HANA is mapped to the Postgres sqlglot dialect (``SQLALCHEMY_URI_ENGINES``
+ has no dedicated HANA dialect), and Postgres's generator uppercases
+ quoted identifiers that mix case, e.g. ``"zbw.10_001/INVENTORY"`` becomes
+ ``"ZBW.10_001/INVENTORY"``. HANA's calculation-view table names are
+ case-sensitive, so the re-cased identifier no longer resolves and SQL Lab
+ fails with ``invalid table name`` even though the user's original query
+ was valid.
+ """
+ sql = (
+ 'SELECT * FROM _sys_bic."zbw.10_001/INVENTORY"\n'
+ "(\n"
+ " 'PLACEHOLDER' = ('$$IP_DATE_TO$$', ''),\n"
+ " 'PLACEHOLDER' = ('$$IP_DATE_FROM$$', '')\n"
+ ")"
+ )
+ formatted = SQLStatement(sql, engine="hana").format()
+
+ assert '"zbw.10_001/INVENTORY"' in formatted
+ assert "$$IP_DATE_TO$$" in formatted
+ assert "$$IP_DATE_FROM$$" in formatted
+
+
def test_split_no_dialect() -> None:
"""
Test the statement split when the engine has no corresponding dialect.