Skip to content

Commit

Permalink
sorting by main metric DESC by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Oct 12, 2020
1 parent 7992bc3 commit 22aa5c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function DatabaseList({ addDangerToast, addSuccessToast }: DatabaseListProps) {
Header: (
<TooltipWrapper
label="allow-dml-header"
tooltip={t('Allow Data Danipulation Language')}
tooltip={t('Allow Data Manipulation Language')}
placement="top"
>
<span>{t('DML')}</span>
Expand Down
4 changes: 4 additions & 0 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,10 @@ def query_obj(self) -> QueryObjectDict:
if sort_by_label not in d["metrics"]:
d["metrics"].append(sort_by)
d["orderby"] = [(sort_by, not fd.get("order_desc", True))]
elif d["metrics"]:
# Legacy behavior of sorting by first metric by default
first_metric = d["metrics"][0]
d["orderby"] = [(first_metric, not fd.get("order_desc", True))]
return d

def get_data(self, df: pd.DataFrame) -> VizData:
Expand Down

0 comments on commit 22aa5c9

Please sign in to comment.