mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
chore(druid): Remove legacy Druid NoSQL logic (#23997)
This commit is contained in:
@@ -67,11 +67,6 @@ ROLE_ALL_PERM_DATA = {
|
||||
"name": "examples",
|
||||
"schema": [{"name": "", "datasources": ["birth_names"]}],
|
||||
},
|
||||
{
|
||||
"datasource_type": "druid",
|
||||
"name": "druid_test",
|
||||
"schema": [{"name": "", "datasources": ["druid_ds_1", "druid_ds_2"]}],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
@@ -959,7 +959,6 @@ class TestGetChartDataApi(BaseTestChartDataApi):
|
||||
"filters": [],
|
||||
"extras": {
|
||||
"having": "",
|
||||
"having_druid": [],
|
||||
"where": "",
|
||||
},
|
||||
"applied_time_extras": {},
|
||||
|
||||
@@ -188,6 +188,6 @@ def _get_energy_slices():
|
||||
"xscale_interval": "1",
|
||||
"yscale_interval": "1",
|
||||
},
|
||||
"query_context": '{"datasource":{"id":12,"type":"table"},"force":false,"queries":[{"time_range":" : ","filters":[],"extras":{"time_grain_sqla":null,"having":"","having_druid":[],"where":""},"applied_time_extras":{},"columns":[],"metrics":[],"annotation_layers":[],"row_limit":5000,"timeseries_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{}}],"result_format":"json","result_type":"full"}',
|
||||
"query_context": '{"datasource":{"id":12,"type":"table"},"force":false,"queries":[{"time_range":" : ","filters":[],"extras":{"time_grain_sqla":null,"having":"","where":""},"applied_time_extras":{},"columns":[],"metrics":[],"annotation_layers":[],"row_limit":5000,"timeseries_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{}}],"result_format":"json","result_type":"full"}',
|
||||
},
|
||||
]
|
||||
|
||||
@@ -550,7 +550,7 @@ chart_config: dict[str, Any] = {
|
||||
},
|
||||
"viz_type": "deck_path",
|
||||
},
|
||||
"query_context": '{"datasource":{"id":12,"type":"table"},"force":false,"queries":[{"time_range":" : ","filters":[],"extras":{"time_grain_sqla":null,"having":"","having_druid":[],"where":""},"applied_time_extras":{},"columns":[],"metrics":[],"annotation_layers":[],"row_limit":5000,"timeseries_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{}}],"result_format":"json","result_type":"full"}',
|
||||
"query_context": '{"datasource":{"id":12,"type":"table"},"force":false,"queries":[{"time_range":" : ","filters":[],"extras":{"time_grain_sqla":null,"having":"","where":""},"applied_time_extras":{},"columns":[],"metrics":[],"annotation_layers":[],"row_limit":5000,"timeseries_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{}}],"result_format":"json","result_type":"full"}',
|
||||
"cache_timeout": None,
|
||||
"uuid": "0c23747a-6528-4629-97bf-e4b78d3b9df1",
|
||||
"version": "1.0.0",
|
||||
|
||||
@@ -35,7 +35,6 @@ sample_query_context = {
|
||||
"time_grain_sqla": "P1D",
|
||||
"time_range_endpoints": ["inclusive", "exclusive"],
|
||||
"having": "",
|
||||
"having_druid": [],
|
||||
"where": "",
|
||||
},
|
||||
"applied_time_extras": {},
|
||||
@@ -93,7 +92,6 @@ sample_query_context = {
|
||||
"time_grain_sqla": "P1D",
|
||||
"time_range_endpoints": ["inclusive", "exclusive"],
|
||||
"having": "",
|
||||
"having_druid": [],
|
||||
"where": "",
|
||||
},
|
||||
"applied_time_extras": {},
|
||||
|
||||
@@ -242,7 +242,6 @@ class TestUtils(SupersetTestCase):
|
||||
{"col": "__time_col", "op": "in", "val": "birth_year"},
|
||||
{"col": "__time_grain", "op": "in", "val": "years"},
|
||||
{"col": "A", "op": "like", "val": "hello"},
|
||||
{"col": "__granularity", "op": "in", "val": "90 seconds"},
|
||||
]
|
||||
}
|
||||
expected = {
|
||||
@@ -260,12 +259,10 @@ class TestUtils(SupersetTestCase):
|
||||
"time_range": "1 year ago :",
|
||||
"granularity_sqla": "birth_year",
|
||||
"time_grain_sqla": "years",
|
||||
"granularity": "90 seconds",
|
||||
"applied_time_extras": {
|
||||
"__time_range": "1 year ago :",
|
||||
"__time_col": "birth_year",
|
||||
"__time_grain": "years",
|
||||
"__granularity": "90 seconds",
|
||||
},
|
||||
}
|
||||
merge_extra_filters(form_data)
|
||||
@@ -634,38 +631,6 @@ class TestUtils(SupersetTestCase):
|
||||
convert_legacy_filters_into_adhoc(form_data)
|
||||
self.assertEqual(form_data, expected)
|
||||
|
||||
def test_convert_legacy_filters_into_adhoc_having(self):
|
||||
form_data = {"having": "COUNT(1) = 1"}
|
||||
expected = {
|
||||
"adhoc_filters": [
|
||||
{
|
||||
"clause": "HAVING",
|
||||
"expressionType": "SQL",
|
||||
"filterOptionName": "683f1c26466ab912f75a00842e0f2f7b",
|
||||
"sqlExpression": "COUNT(1) = 1",
|
||||
}
|
||||
]
|
||||
}
|
||||
convert_legacy_filters_into_adhoc(form_data)
|
||||
self.assertEqual(form_data, expected)
|
||||
|
||||
def test_convert_legacy_filters_into_adhoc_having_filters(self):
|
||||
form_data = {"having_filters": [{"col": "COUNT(1)", "op": "==", "val": 1}]}
|
||||
expected = {
|
||||
"adhoc_filters": [
|
||||
{
|
||||
"clause": "HAVING",
|
||||
"comparator": 1,
|
||||
"expressionType": "SIMPLE",
|
||||
"filterOptionName": "967d0fb409f6d9c7a6c03a46cf933c9c",
|
||||
"operator": "==",
|
||||
"subject": "COUNT(1)",
|
||||
}
|
||||
]
|
||||
}
|
||||
convert_legacy_filters_into_adhoc(form_data)
|
||||
self.assertEqual(form_data, expected)
|
||||
|
||||
def test_convert_legacy_filters_into_adhoc_present_and_empty(self):
|
||||
form_data = {"adhoc_filters": [], "where": "a = 1"}
|
||||
expected = {
|
||||
@@ -681,6 +646,21 @@ class TestUtils(SupersetTestCase):
|
||||
convert_legacy_filters_into_adhoc(form_data)
|
||||
self.assertEqual(form_data, expected)
|
||||
|
||||
def test_convert_legacy_filters_into_adhoc_having(self):
|
||||
form_data = {"having": "COUNT(1) = 1"}
|
||||
expected = {
|
||||
"adhoc_filters": [
|
||||
{
|
||||
"clause": "HAVING",
|
||||
"expressionType": "SQL",
|
||||
"filterOptionName": "683f1c26466ab912f75a00842e0f2f7b",
|
||||
"sqlExpression": "COUNT(1) = 1",
|
||||
}
|
||||
]
|
||||
}
|
||||
convert_legacy_filters_into_adhoc(form_data)
|
||||
self.assertEqual(form_data, expected)
|
||||
|
||||
def test_convert_legacy_filters_into_adhoc_present_and_nonempty(self):
|
||||
form_data = {
|
||||
"adhoc_filters": [
|
||||
@@ -688,7 +668,6 @@ class TestUtils(SupersetTestCase):
|
||||
],
|
||||
"filters": [{"col": "a", "op": "in", "val": "someval"}],
|
||||
"having": "COUNT(1) = 1",
|
||||
"having_filters": [{"col": "COUNT(1)", "op": "==", "val": 1}],
|
||||
}
|
||||
expected = {
|
||||
"adhoc_filters": [
|
||||
|
||||
Reference in New Issue
Block a user