mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix: handle duplicate groupby keys (#8658)
* fix: handle duplicate groupby keys * Also de-duping upfront
This commit is contained in:
committed by
GitHub
parent
f4ad15e644
commit
35c697560e
@@ -721,6 +721,9 @@ class SqlaTable(Model, BaseDatasource):
|
||||
groupby_exprs_sans_timestamp: OrderedDict = OrderedDict()
|
||||
|
||||
if groupby:
|
||||
# dedup columns while preserving order
|
||||
groupby = list(dict.fromkeys(groupby))
|
||||
|
||||
select_exprs = []
|
||||
for s in groupby:
|
||||
if s in cols:
|
||||
|
||||
@@ -970,6 +970,10 @@ class BubbleViz(NVD3Viz):
|
||||
d["groupby"] = [form_data.get("entity")]
|
||||
if form_data.get("series"):
|
||||
d["groupby"].append(form_data.get("series"))
|
||||
|
||||
# dedup groupby if it happens to be the same
|
||||
d["groupby"] = list(dict.fromkeys(d["groupby"]))
|
||||
|
||||
self.x_metric = form_data.get("x")
|
||||
self.y_metric = form_data.get("y")
|
||||
self.z_metric = form_data.get("size")
|
||||
|
||||
Reference in New Issue
Block a user