Skip to content

Commit

Permalink
Remove the use of Pandas' iloc() in WorldMapViz
Browse files Browse the repository at this point in the history
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:
71e0c07#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
  • Loading branch information
elukey committed May 2, 2019
1 parent 4fe152d commit cdf93f9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -1765,9 +1765,7 @@ def get_data(self, df):
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:
Expand Down

0 comments on commit cdf93f9

Please sign in to comment.