Skip to content

Commit

Permalink
feat(filter-box): sort by metric on backend (apache#14340)
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro authored Apr 26, 2021
1 parent db7029b commit 3f1aa5d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -2069,6 +2069,9 @@ def run_extra_queries(self) -> None:
qry["groupby"] = [col]
metric = flt.get("metric")
qry["metrics"] = [metric] if metric else []
asc = flt.get("asc")
if metric and asc is not None:
qry["orderby"] = [(metric, asc)]
QueryContext(
datasource={"id": self.datasource.id, "type": self.datasource.type},
queries=[qry],
Expand Down

0 comments on commit 3f1aa5d

Please sign in to comment.