Skip to content

Commit

Permalink
[hotfix] fix world map
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Mar 4, 2017
1 parent f6ffc00 commit 9d8d421
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions superset/assets/javascripts/explorev2/stores/controls.jsx
Expand Up @@ -266,9 +266,9 @@ export const controls = {
}),
},

country_controltype: {
country_fieldtype: {
type: 'SelectControl',
label: 'Country Control Type',
label: 'Country Field Type',
default: 'cca2',
choices: [
['name', 'Full name'],
Expand Down
2 changes: 1 addition & 1 deletion superset/assets/javascripts/explorev2/stores/visTypes.js
Expand Up @@ -572,7 +572,7 @@ const visTypes = {
label: null,
controlSetRows: [
['entity'],
['country_controltype'],
['country_fieldtype'],
['metric'],
],
},
Expand Down
9 changes: 5 additions & 4 deletions superset/viz.py
Expand Up @@ -1291,9 +1291,10 @@ def query_obj(self):

def get_data(self, df):
from superset.data import countries
cols = [self.form_data.get('entity')]
metric = self.form_data.get('metric')
secondary_metric = self.form_data.get('secondary_metric')
fd = self.form_data
cols = [fd.get('entity')]
metric = fd.get('metric')
secondary_metric = fd.get('secondary_metric')
if metric == secondary_metric:
ndf = df[cols]
# df[metric] will be a DataFrame
Expand All @@ -1310,7 +1311,7 @@ def get_data(self, df):
country = None
if isinstance(row['country'], string_types):
country = countries.get(
self.form_data.get('country_fieldtype'), row['country'])
fd.get('country_fieldtype'), row['country'])

if country:
row['country'] = country['cca3']
Expand Down

0 comments on commit 9d8d421

Please sign in to comment.