You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/09/19 13:38:04 UTC

[GitHub] [incubator-superset] villebro commented on a change in pull request #10966: feat: add ECharts Pie chart

villebro commented on a change in pull request #10966:
URL: https://github.com/apache/incubator-superset/pull/10966#discussion_r491438675



##########
File path: tests/viz_tests.py
##########
@@ -1384,60 +1384,3 @@ def test_format_datetime_from_invalid_string(self):
     def test_format_datetime_from_int(self):
         assert viz.PivotTableViz._format_datetime(123) == 123
         assert viz.PivotTableViz._format_datetime(123.0) == 123.0
-
-
-class TestDistributionPieViz(SupersetTestCase):
-    base_df = pd.DataFrame(
-        data={
-            "intcol": [1, 2, 3, 4, None],
-            "floatcol": [1.0, 0.2, 0.3, 0.4, None],
-            "strcol_a": ["a", "a", "a", "a", None],
-            "strcol": ["a", "b", "c", None, "d"],
-        }
-    )
-
-    @staticmethod
-    def get_cols(data: List[Dict[str, Any]]) -> Set[str]:
-        return set([row["x"] for row in data])
-
-    def test_bool_groupby(self):
-        datasource = self.get_datasource_mock()
-        df = pd.DataFrame(data={"intcol": [1, 2, None], "boolcol": [True, None, False]})
-
-        pie_viz = viz.DistributionPieViz(
-            datasource, {"metrics": ["intcol"], "groupby": ["boolcol"]},
-        )
-        data = pie_viz.get_data(df)
-        assert self.get_cols(data) == {"True", "False", "<NULL>"}
-
-    def test_string_groupby(self):
-        datasource = self.get_datasource_mock()
-        pie_viz = viz.DistributionPieViz(
-            datasource, {"metrics": ["floatcol"], "groupby": ["strcol"]},
-        )
-        data = pie_viz.get_data(self.base_df)
-        assert self.get_cols(data) == {"<NULL>", "a", "b", "c", "d"}
-
-    def test_int_groupby(self):
-        datasource = self.get_datasource_mock()
-        pie_viz = viz.DistributionPieViz(
-            datasource, {"metrics": ["floatcol"], "groupby": ["intcol"]},
-        )
-        data = pie_viz.get_data(self.base_df)
-        assert self.get_cols(data) == {"<NULL>", "1", "2", "3", "4"}
-
-    def test_float_groupby(self):
-        datasource = self.get_datasource_mock()
-        pie_viz = viz.DistributionPieViz(
-            datasource, {"metrics": ["intcol"], "groupby": ["floatcol"]},
-        )
-        data = pie_viz.get_data(self.base_df)
-        assert self.get_cols(data) == {"<NULL>", "1", "0.2", "0.3", "0.4"}
-
-    def test_multi_groupby(self):
-        datasource = self.get_datasource_mock()
-        pie_viz = viz.DistributionPieViz(
-            datasource, {"metrics": ["floatcol"], "groupby": ["intcol", "strcol"]},
-        )
-        data = pie_viz.get_data(self.base_df)
-        assert self.get_cols(data) == {"1, a", "2, b", "3, c", "4, <NULL>", "<NULL>, d"}

Review comment:
       These have been moved to the plugin: https://github.com/apache-superset/superset-ui/blob/d0b6fa03488d732b24fe159a88f38194a3d350d2/plugins/plugin-chart-echarts/test/utils/series.test.ts#L87-L120




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org