Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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')}
Comment thread
mistercrunch marked this conversation as resolved.
placement="top"
>
<span>{t('DML')}</span>
Expand Down
3 changes: 0 additions & 3 deletions superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,9 +1082,6 @@ def get_sqla_query( # pylint: disable=too-many-arguments,too-many-locals,too-ma
qry = qry.where(and_(*where_clause_and))
qry = qry.having(and_(*having_clause_and))

if not orderby and ((is_sip_38 and metrics) or (not is_sip_38 and not columns)):
orderby = [(main_metric_expr, not order_desc)]

# To ensure correct handling of the ORDER BY labeling we need to reference the
# metric instance if defined in the SELECT clause.
metrics_exprs_by_label = {
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