mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
[bugfix] preserve order in groupby (#3268)
Recently in
4c3313b01c
I introduced an issue where the order of groupby fields might change.
This addresses this issue and will preserve ordering.
This commit is contained in:
parent
0cf0860a3d
commit
57421d14d0
@ -112,10 +112,13 @@ class BaseViz(object):
|
||||
def query_obj(self):
|
||||
"""Building a query object"""
|
||||
form_data = self.form_data
|
||||
groupby = form_data.get("groupby") or []
|
||||
gb = form_data.get("groupby") or []
|
||||
metrics = form_data.get("metrics") or []
|
||||
columns = form_data.get("columns") or []
|
||||
groupby = list(set(groupby + columns))
|
||||
groupby = []
|
||||
for o in gb + columns:
|
||||
if o not in groupby:
|
||||
groupby.append(o)
|
||||
|
||||
is_timeseries = self.is_timeseries
|
||||
if DTTM_ALIAS in groupby:
|
||||
|
Loading…
Reference in New Issue
Block a user