fix(tests): one of integration test in TestSqlaTableModel does not support MySQL "concat" (#35007)

Co-authored-by: Mehmet Salih Yavuz <salih.yavuz@proton.me>
This commit is contained in:
catpineapple
2025-09-06 02:11:38 +08:00
committed by GitHub
parent a20b236809
commit 9efb80dbf4

View File

@@ -448,11 +448,14 @@ class TestSqlaTableModel(SupersetTestCase):
return None
old_inner_join = spec.allows_joins
spec.allows_joins = inner_join
# Use database-specific string concatenation syntax
arbitrary_gby = (
"state OR gender OR '_test'"
"CONCAT(state, gender, '_test')"
if get_example_database().backend == "mysql"
else "state || gender || '_test'"
)
arbitrary_metric = dict( # noqa: C408
label="arbitrary", expressionType="SQL", sqlExpression="SUM(num_boys)"
)