From b1d0cdf49bb4f8311039d110c219d1ce437e0924 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Thu, 21 Apr 2016 20:50:28 -0700 Subject: [PATCH] Fixing #388 --- caravel/models.py | 2 +- tests/core_tests.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/caravel/models.py b/caravel/models.py index 090d0ec27c547..6bf8f88247012 100644 --- a/caravel/models.py +++ b/caravel/models.py @@ -1113,7 +1113,7 @@ def query( # druid }], } client.groupby(**qry) - query_str += json.dumps(qry, indent=2) + query_str += json.dumps(client.query_dict, indent=2) df = client.export_pandas() if df is None or df.size == 0: raise Exception("No data was returned.") diff --git a/tests/core_tests.py b/tests/core_tests.py index d75be6ba7ce2b..d9a4e95855396 100644 --- a/tests/core_tests.py +++ b/tests/core_tests.py @@ -228,6 +228,7 @@ def test_client(self, PyDruid): import pandas as pd df = pd.DataFrame(nres) instance.export_pandas.return_value = df + instance.query_dict = {} resp = self.client.get('/caravel/explore/druid/1/?viz_type=table&granularity=one+day&druid_time_origin=&since=7+days+ago&until=now&row_limit=5000&include_search=false&metrics=count&flt_col_0=dim1&flt_op_0=in&flt_eq_0=&slice_id=&slice_name=&collapsed_fieldsets=&action=&datasource_name=test_datasource&datasource_id=1&datasource_type=druid&previous_viz_type=table&json=true&force=true') print('-'*300) print(resp.data.decode('utf-8'))