chore: Refactor ExploreMixin to power both Datasets (SqlaTable) and Query models (#22853)

This commit is contained in:
Hugh A. Miles II
2023-04-10 16:32:52 -04:00
committed by GitHub
parent b44d20348d
commit d581d698b6
10 changed files with 413 additions and 967 deletions

View File

@@ -1242,8 +1242,8 @@ def test_chart_cache_timeout_chart_not_found(
[
(200, {"where": "1 = 1"}),
(200, {"having": "count(*) > 0"}),
(400, {"where": "col1 in (select distinct col1 from physical_dataset)"}),
(400, {"having": "count(*) > (select count(*) from physical_dataset)"}),
(403, {"where": "col1 in (select distinct col1 from physical_dataset)"}),
(403, {"having": "count(*) > (select count(*) from physical_dataset)"}),
],
)
@with_feature_flags(ALLOW_ADHOC_SUBQUERY=False)

View File

@@ -493,8 +493,16 @@ class TestSqlLab(SupersetTestCase):
"datasourceName": f"test_viz_flow_table_{random()}",
"schema": "superset",
"columns": [
{"is_dttm": False, "type": "STRING", "name": f"viz_type_{random()}"},
{"is_dttm": False, "type": "OBJECT", "name": f"ccount_{random()}"},
{
"is_dttm": False,
"type": "STRING",
"column_name": f"viz_type_{random()}",
},
{
"is_dttm": False,
"type": "OBJECT",
"column_name": f"ccount_{random()}",
},
],
"sql": """\
SELECT *
@@ -523,8 +531,16 @@ class TestSqlLab(SupersetTestCase):
"chartType": "dist_bar",
"schema": "superset",
"columns": [
{"is_dttm": False, "type": "STRING", "name": f"viz_type_{random()}"},
{"is_dttm": False, "type": "OBJECT", "name": f"ccount_{random()}"},
{
"is_dttm": False,
"type": "STRING",
"column_name": f"viz_type_{random()}",
},
{
"is_dttm": False,
"type": "OBJECT",
"column_name": f"ccount_{random()}",
},
],
"sql": """\
SELECT *