This is an automated email from the ASF dual-hosted git repository.

johnbodley pushed a commit to branch feature--embeddable-charts-pilot
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git

commit c9c6ff1058f13d27326c199b6b00a086de55b50e
Author: Conglei Shi <[email protected]>
AuthorDate: Tue Dec 18 15:04:47 2018 -0800

    fixed the metric format in filterViz
---
 superset/assets/cypress/fixtures/example.json | 5 +++++
 superset/viz.py                               | 7 +++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/superset/assets/cypress/fixtures/example.json 
b/superset/assets/cypress/fixtures/example.json
new file mode 100644
index 0000000..da18d93
--- /dev/null
+++ b/superset/assets/cypress/fixtures/example.json
@@ -0,0 +1,5 @@
+{
+  "name": "Using fixtures to represent data",
+  "email": "[email protected]",
+  "body": "Fixtures are a great way to mock data for responses to routes"
+}
\ No newline at end of file
diff --git a/superset/viz.py b/superset/viz.py
index 1fbd7c9..9593136 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -1811,8 +1811,11 @@ class FilterBoxViz(BaseViz):
         groupby = self.form_data.get('groupby')
         if len(groupby) < 1 and not self.form_data.get('date_filter'):
             raise Exception(_('Pick at least one filter field'))
-        qry['metrics'] = [
-            self.form_data['metric']]
+        metric = {
+            'label': self.form_data['metric'],
+            'expressionType': 'BUILTIN',
+        }
+        qry['metrics'] = [metric]
         return qry
 
     def get_data(self, df):

Reply via email to