diff --git a/superset/assets/javascripts/explorev2/stores/controls.jsx b/superset/assets/javascripts/explorev2/stores/controls.jsx index 9daafa74ee08f..09578f5304b97 100644 --- a/superset/assets/javascripts/explorev2/stores/controls.jsx +++ b/superset/assets/javascripts/explorev2/stores/controls.jsx @@ -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'], diff --git a/superset/assets/javascripts/explorev2/stores/visTypes.js b/superset/assets/javascripts/explorev2/stores/visTypes.js index 4d8a5076db2a3..7ee613166d040 100644 --- a/superset/assets/javascripts/explorev2/stores/visTypes.js +++ b/superset/assets/javascripts/explorev2/stores/visTypes.js @@ -572,7 +572,7 @@ const visTypes = { label: null, controlSetRows: [ ['entity'], - ['country_controltype'], + ['country_fieldtype'], ['metric'], ], }, diff --git a/superset/viz.py b/superset/viz.py index 82c68d05345c3..61fd4ed557a66 100755 --- a/superset/viz.py +++ b/superset/viz.py @@ -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 @@ -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']