superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Remove the use of Pandas' iloc() in WorldMapViz (#7379)
Date Tue, 28 May 2019 21:19:14 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new b21f8ec  Remove the use of Pandas' iloc() in  WorldMapViz (#7379)
b21f8ec is described below

commit b21f8ec80436487e5778bcacd12205f6a2cfe46c
Author: Luca Toscano <elukey@users.noreply.github.com>
AuthorDate: Tue May 28 23:19:04 2019 +0200

    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 a9e3f93..8eb0620 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:


Mime
View raw message