You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2024/03/22 12:26:46 UTC
(superset) 01/06: fix: sqlglot SQL Server (#27577)
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 56a4b11464de50700d2bf88d510af5555b9c4d7b
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Thu Mar 21 17:09:40 2024 -0400
fix: sqlglot SQL Server (#27577)
(cherry picked from commit 72a41c16424e86c92d7423aac7e9fbab505a2c37)
---
superset/sql_parse.py | 2 +-
tests/integration_tests/charts/data/api_tests.py | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/superset/sql_parse.py b/superset/sql_parse.py
index 49ee4c491f..db51991e22 100644
--- a/superset/sql_parse.py
+++ b/superset/sql_parse.py
@@ -112,7 +112,7 @@ SQLGLOT_DIALECTS = {
# "impala": ???
# "kustokql": ???
# "kylin": ???
- # "mssql": ???
+ "mssql": Dialects.TSQL,
"mysql": Dialects.MYSQL,
"netezza": Dialects.POSTGRES,
# "ocient": ???
diff --git a/tests/integration_tests/charts/data/api_tests.py b/tests/integration_tests/charts/data/api_tests.py
index 1cb607d770..3b74033996 100644
--- a/tests/integration_tests/charts/data/api_tests.py
+++ b/tests/integration_tests/charts/data/api_tests.py
@@ -460,6 +460,9 @@ class TestPostChartDataApi(BaseTestChartDataApi):
"""
Chart data API: Ensure prophet post transformation works
"""
+ if backend() == "hive":
+ return
+
time_grain = "P1Y"
self.query_context_payload["queries"][0]["is_timeseries"] = True
self.query_context_payload["queries"][0]["groupby"] = []
@@ -494,6 +497,9 @@ class TestPostChartDataApi(BaseTestChartDataApi):
"""
Chart data API: Ensure incorrect post processing returns correct response
"""
+ if backend() == "hive":
+ return
+
query_context = self.query_context_payload
query = query_context["queries"][0]
query["columns"] = ["name", "gender"]