mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
[hotfix] druid queries 'There was no query executed' issue
This commit is contained in:
parent
dd7b4b8310
commit
c5859c7254
@ -726,13 +726,13 @@ class DruidDatasource(Model, BaseDatasource):
|
|||||||
orderby=None,
|
orderby=None,
|
||||||
extras=None, # noqa
|
extras=None, # noqa
|
||||||
select=None, # noqa
|
select=None, # noqa
|
||||||
columns=None, phase=2):
|
columns=None, phase=2, client=None):
|
||||||
"""Runs a query against Druid and returns a dataframe.
|
"""Runs a query against Druid and returns a dataframe.
|
||||||
|
|
||||||
This query interface is common to SqlAlchemy and Druid
|
This query interface is common to SqlAlchemy and Druid
|
||||||
"""
|
"""
|
||||||
# TODO refactor into using a TBD Query object
|
# 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:
|
if not is_timeseries:
|
||||||
granularity = 'all'
|
granularity = 'all'
|
||||||
inner_from_dttm = inner_from_dttm or from_dttm
|
inner_from_dttm = inner_from_dttm or from_dttm
|
||||||
@ -933,7 +933,7 @@ class DruidDatasource(Model, BaseDatasource):
|
|||||||
def query(self, query_obj):
|
def query(self, query_obj):
|
||||||
qry_start_dttm = datetime.now()
|
qry_start_dttm = datetime.now()
|
||||||
client = self.cluster.get_pydruid_client()
|
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()
|
df = client.export_pandas()
|
||||||
|
|
||||||
if df is None or df.size == 0:
|
if df is None or df.size == 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user