From 1d0ec9fe6e30ba0cddfc142c2ad851307439e435 Mon Sep 17 00:00:00 2001 From: michellethomas Date: Tue, 13 Mar 2018 09:25:14 -0700 Subject: [PATCH] timeseries_limit should not be required for phase 2 (#4581) --- superset/connectors/druid/models.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/superset/connectors/druid/models.py b/superset/connectors/druid/models.py index caef04b5d8..3eb709026b 100644 --- a/superset/connectors/druid/models.py +++ b/superset/connectors/druid/models.py @@ -1068,10 +1068,7 @@ class DruidDatasource(Model, BaseDatasource): if not is_timeseries: granularity = 'all' - if ( - granularity == 'all' or - timeseries_limit is None or - timeseries_limit == 0): + if granularity == 'all': phase = 1 inner_from_dttm = inner_from_dttm or from_dttm inner_to_dttm = inner_to_dttm or to_dttm @@ -1151,7 +1148,8 @@ class DruidDatasource(Model, BaseDatasource): client.topn(**pre_qry) logging.info('Phase 1 Complete') - query_str += '// Two phase query\n// Phase 1\n' + if phase == 2: + query_str += '// Two phase query\n// Phase 1\n' query_str += json.dumps( client.query_builder.last_query.query_dict, indent=2) query_str += '\n'