mirror of https://github.com/apache/superset.git
Fixing filter for timeseries
This commit is contained in:
parent
4bb313cc44
commit
056be737af
|
@ -19,6 +19,7 @@ class ColumnInlineView(CompactCRUDMixin, ModelView):
|
|||
'column_name', 'type', 'groupby', 'count_distinct',
|
||||
'sum', 'min', 'max']
|
||||
can_delete = False
|
||||
page_size = 100
|
||||
appbuilder.add_view_no_menu(ColumnInlineView)
|
||||
|
||||
|
||||
|
@ -30,6 +31,7 @@ class MetricInlineView(CompactCRUDMixin, ModelView):
|
|||
'datasource', 'json']
|
||||
add_columns = [
|
||||
'metric_name', 'verbose_name', 'metric_type', 'datasource', 'json']
|
||||
page_size = 100
|
||||
appbuilder.add_view_no_menu(MetricInlineView)
|
||||
|
||||
|
||||
|
|
|
@ -260,6 +260,7 @@ class TimeSeriesViz(HighchartsViz):
|
|||
"""
|
||||
client = utils.get_pydruid_client()
|
||||
qry = self.query_obj()
|
||||
orig_filter = qry['filter'] if 'filter' in qry else ''
|
||||
qry['granularity'] = "all"
|
||||
client.groupby(**qry)
|
||||
df = client.export_pandas()
|
||||
|
@ -279,7 +280,12 @@ class TimeSeriesViz(HighchartsViz):
|
|||
qry = self.query_obj()
|
||||
if filters:
|
||||
ff = Filter(type="or", fields=filters)
|
||||
qry['filter'] = ff
|
||||
if not orig_filter:
|
||||
qry['filter'] = ff
|
||||
else:
|
||||
qry['filter'] = Filter(type="and", fields=[
|
||||
Filter.build_filter(ff),
|
||||
Filter.build_filter(orig_filter)])
|
||||
del qry['limit_spec']
|
||||
client.groupby(**qry)
|
||||
return client.export_pandas()
|
||||
|
|
Loading…
Reference in New Issue