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',
|
'column_name', 'type', 'groupby', 'count_distinct',
|
||||||
'sum', 'min', 'max']
|
'sum', 'min', 'max']
|
||||||
can_delete = False
|
can_delete = False
|
||||||
|
page_size = 100
|
||||||
appbuilder.add_view_no_menu(ColumnInlineView)
|
appbuilder.add_view_no_menu(ColumnInlineView)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -30,6 +31,7 @@ class MetricInlineView(CompactCRUDMixin, ModelView):
|
||||||
'datasource', 'json']
|
'datasource', 'json']
|
||||||
add_columns = [
|
add_columns = [
|
||||||
'metric_name', 'verbose_name', 'metric_type', 'datasource', 'json']
|
'metric_name', 'verbose_name', 'metric_type', 'datasource', 'json']
|
||||||
|
page_size = 100
|
||||||
appbuilder.add_view_no_menu(MetricInlineView)
|
appbuilder.add_view_no_menu(MetricInlineView)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -260,6 +260,7 @@ class TimeSeriesViz(HighchartsViz):
|
||||||
"""
|
"""
|
||||||
client = utils.get_pydruid_client()
|
client = utils.get_pydruid_client()
|
||||||
qry = self.query_obj()
|
qry = self.query_obj()
|
||||||
|
orig_filter = qry['filter'] if 'filter' in qry else ''
|
||||||
qry['granularity'] = "all"
|
qry['granularity'] = "all"
|
||||||
client.groupby(**qry)
|
client.groupby(**qry)
|
||||||
df = client.export_pandas()
|
df = client.export_pandas()
|
||||||
|
|
@ -279,7 +280,12 @@ class TimeSeriesViz(HighchartsViz):
|
||||||
qry = self.query_obj()
|
qry = self.query_obj()
|
||||||
if filters:
|
if filters:
|
||||||
ff = Filter(type="or", fields=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']
|
del qry['limit_spec']
|
||||||
client.groupby(**qry)
|
client.groupby(**qry)
|
||||||
return client.export_pandas()
|
return client.export_pandas()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue