From b21f8ec80436487e5778bcacd12205f6a2cfe46c Mon Sep 17 00:00:00 2001 From: Luca Toscano Date: Tue, 28 May 2019 23:19:04 +0200 Subject: [PATCH] Remove the use of Pandas' iloc() in WorldMapViz (#7379) When the same metric is used in a World Map panel for both bubble size and an axis (either X or Y), it currently breaks the rendering. The change in behavior was introduced in: https://github.com/apache/incubator-superset/commit/71e0c079041c4f955e8529349baa17058e70d256#diff-f451672348fc6071e8d627778bdc4e96L1730 The use of .iloc() is not needed anymore since the code that used to duplicate the metric is not there anymore. Should fix #7006 --- superset/viz.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/superset/viz.py b/superset/viz.py index a9e3f93e4..8eb062048 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -1765,9 +1765,7 @@ class WorldMapViz(BaseViz): columns = ['country', 'm1', 'm2'] if metric == secondary_metric: ndf = df[cols] - # df[metric] will be a DataFrame - # because there are duplicate column names - ndf['m1'] = df[metric].iloc[:, 0] + ndf['m1'] = df[metric] ndf['m2'] = ndf['m1'] else: if secondary_metric: