mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix: invalid metric should raise an exception (#20882)
This commit is contained in:
@@ -43,5 +43,5 @@
|
||||
"granularity_sqla": null,
|
||||
"autozoom": true,
|
||||
"url_params": {},
|
||||
"size": 100
|
||||
"size": "100"
|
||||
}
|
||||
|
||||
@@ -45,5 +45,5 @@
|
||||
"granularity_sqla": null,
|
||||
"autozoom": true,
|
||||
"url_params": {},
|
||||
"size": 100
|
||||
"size": "100"
|
||||
}
|
||||
|
||||
@@ -716,7 +716,7 @@ class TestPairedTTest(SupersetTestCase):
|
||||
self.assertEqual(data, expected)
|
||||
|
||||
def test_get_data_empty_null_keys(self):
|
||||
form_data = {"groupby": [], "metrics": ["", None]}
|
||||
form_data = {"groupby": [], "metrics": [""]}
|
||||
datasource = self.get_datasource_mock()
|
||||
# Test data
|
||||
raw = {}
|
||||
@@ -739,19 +739,13 @@ class TestPairedTTest(SupersetTestCase):
|
||||
"group": "All",
|
||||
}
|
||||
],
|
||||
"NULL": [
|
||||
{
|
||||
"values": [
|
||||
{"x": 100, "y": 10},
|
||||
{"x": 200, "y": 20},
|
||||
{"x": 300, "y": 30},
|
||||
],
|
||||
"group": "All",
|
||||
}
|
||||
],
|
||||
}
|
||||
self.assertEqual(data, expected)
|
||||
|
||||
form_data = {"groupby": [], "metrics": [None]}
|
||||
with self.assertRaises(ValueError):
|
||||
viz.viz_types["paired_ttest"](datasource, form_data)
|
||||
|
||||
|
||||
class TestPartitionViz(SupersetTestCase):
|
||||
@patch("superset.viz.BaseViz.query_obj")
|
||||
|
||||
Reference in New Issue
Block a user