From 7c455e60c213a17ec4792798c9c83664fead4790 Mon Sep 17 00:00:00 2001 From: Yilei Cai Date: Wed, 15 Mar 2017 22:06:31 -0700 Subject: [PATCH 1/2] fix a bug in pie chart --- superset/viz.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/superset/viz.py b/superset/viz.py index 02fc0791ad6b6..bae0ca5dfb544 100755 --- a/superset/viz.py +++ b/superset/viz.py @@ -1085,11 +1085,12 @@ class DistributionPieViz(NVD3Viz): is_timeseries = False def get_data(self, df): + df = self.get_df() df = df.pivot_table( index=self.groupby, values=[self.metrics[0]]) df.sort_values(by=self.metrics[0], ascending=False, inplace=True) - df = self.get_df() + df = df.reset_index() df.columns = ['x', 'y'] return df.to_dict(orient="records") From 9a724faeb93998890174ae7f99982afe12b1bbc8 Mon Sep 17 00:00:00 2001 From: Yilei Cai Date: Fri, 17 Mar 2017 10:39:10 -0700 Subject: [PATCH 2/2] remove unnecessary line --- superset/viz.py | 1 - 1 file changed, 1 deletion(-) diff --git a/superset/viz.py b/superset/viz.py index bae0ca5dfb544..c1f0c3f6c5429 100755 --- a/superset/viz.py +++ b/superset/viz.py @@ -1085,7 +1085,6 @@ class DistributionPieViz(NVD3Viz): is_timeseries = False def get_data(self, df): - df = self.get_df() df = df.pivot_table( index=self.groupby, values=[self.metrics[0]])