From 368c85de1b8fec74dc2df38df92527dede4a00c4 Mon Sep 17 00:00:00 2001 From: michellethomas Date: Wed, 20 May 2020 10:20:54 -0700 Subject: [PATCH] fix: Removing the logic to add timeseries_limit_metric to the data for table (#9832) * Removing the logic to add timeseries_limit_metric to the data for table viz * Also make the change in viz_sip_38 * Fix tests Co-authored-by: michelle_thomas --- superset/viz.py | 6 ------ superset/viz_sip38.py | 6 ------ tests/viz_tests.py | 2 +- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/superset/viz.py b/superset/viz.py index cc5a89a7e..af5d82d19 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -637,12 +637,6 @@ class TableViz(BaseViz): utils.get_metric_names(self.form_data.get("metrics") or []) ) - timeseries_limit_metric = utils.get_metric_name( - self.form_data.get("timeseries_limit_metric") - ) - if timeseries_limit_metric: - non_percent_metric_columns.append(timeseries_limit_metric) - percent_metric_columns = utils.get_metric_names( self.form_data.get("percent_metrics") or [] ) diff --git a/superset/viz_sip38.py b/superset/viz_sip38.py index 59ff14810..df43c9e10 100644 --- a/superset/viz_sip38.py +++ b/superset/viz_sip38.py @@ -676,12 +676,6 @@ class TableViz(BaseViz): utils.get_metric_names(self.form_data.get("metrics") or []) ) - timeseries_limit_metric = utils.get_metric_name( - self.form_data.get("timeseries_limit_metric") - ) - if timeseries_limit_metric: - non_percent_metric_columns.append(timeseries_limit_metric) - percent_metric_columns = utils.get_metric_names( self.form_data.get("percent_metrics") or [] ) diff --git a/tests/viz_tests.py b/tests/viz_tests.py index ab10f4970..748d50bc6 100644 --- a/tests/viz_tests.py +++ b/tests/viz_tests.py @@ -431,7 +431,7 @@ class TableVizTestCase(SupersetTestCase): datasource = self.get_datasource_mock() test_viz = viz.TableViz(datasource, form_data) data = test_viz.get_data(df) - self.assertEqual(["sum_value", "SUM(value1)"], data["columns"]) + self.assertEqual(["sum_value"], data["columns"]) class DistBarVizTestCase(SupersetTestCase):