mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
[hotfix] issues around empty params
This commit is contained in:
parent
7f3c205c46
commit
98902599ff
@ -271,6 +271,10 @@ class Slice(Model, AuditMixinNullable):
|
||||
slice_params['viz_type'] = self.viz_type if self.viz_type else "table"
|
||||
if url_params_multidict:
|
||||
slice_params.update(url_params_multidict)
|
||||
to_del = [k for k in slice_params if k not in url_params_multidict]
|
||||
for k in to_del:
|
||||
del slice_params[k]
|
||||
|
||||
immutable_slice_params = ImmutableMultiDict(slice_params)
|
||||
return viz_types[immutable_slice_params.get('viz_type')](
|
||||
self.datasource,
|
||||
|
@ -1657,8 +1657,8 @@ class FilterBoxViz(BaseViz):
|
||||
|
||||
def query_obj(self):
|
||||
qry = super(FilterBoxViz, self).query_obj()
|
||||
groupby = self.form_data['groupby']
|
||||
if len(groupby) < 1:
|
||||
groupby = self.form_data.get('groupby')
|
||||
if len(groupby) < 1 and not self.form_data.get('date_filter'):
|
||||
raise Exception("Pick at least one filter field")
|
||||
qry['metrics'] = [
|
||||
self.form_data['metric']]
|
||||
@ -1666,7 +1666,7 @@ class FilterBoxViz(BaseViz):
|
||||
|
||||
def get_data(self):
|
||||
qry = self.query_obj()
|
||||
filters = [g for g in qry['groupby']]
|
||||
filters = [g for g in self.form_data['groupby']]
|
||||
d = {}
|
||||
for flt in filters:
|
||||
qry['groupby'] = [flt]
|
||||
|
Loading…
Reference in New Issue
Block a user