Skip to content

Commit

Permalink
[hotfix] druid queries 'There was no query executed' issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Mar 27, 2017
1 parent dd7b4b8 commit c5859c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions superset/connectors/druid/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,13 +726,13 @@ def get_query_str( # noqa / druid
orderby=None,
extras=None, # noqa
select=None, # noqa
columns=None, phase=2):
columns=None, phase=2, client=None):
"""Runs a query against Druid and returns a dataframe.
This query interface is common to SqlAlchemy and Druid
"""
# TODO refactor into using a TBD Query object
client = self.cluster.get_pydruid_client()
client = client or self.cluster.get_pydruid_client()
if not is_timeseries:
granularity = 'all'
inner_from_dttm = inner_from_dttm or from_dttm
Expand Down Expand Up @@ -933,7 +933,7 @@ def recursive_get_fields(_conf):
def query(self, query_obj):
qry_start_dttm = datetime.now()
client = self.cluster.get_pydruid_client()
query_str = self.get_query_str(**query_obj)
query_str = self.get_query_str(client=client, **query_obj)
df = client.export_pandas()

if df is None or df.size == 0:
Expand Down

0 comments on commit c5859c7

Please sign in to comment.