mirror of
https://github.com/apache/superset.git
synced 2026-04-23 10:04:45 +00:00
fix(table): use column label instead of SQL expression for orderby in downloads (#39332)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
8471e82342
commit
b3e88db87e
@@ -238,12 +238,11 @@ const buildQuery: BuildQuery<TableChartFormData> = (
|
||||
});
|
||||
|
||||
if (matchingColumn) {
|
||||
if (
|
||||
typeof matchingColumn === 'object' &&
|
||||
'sqlExpression' in matchingColumn
|
||||
) {
|
||||
return matchingColumn.sqlExpression;
|
||||
}
|
||||
// Return the label, not the raw sqlExpression. The backend
|
||||
// (helpers.py get_sqla_query) resolves orderby strings by
|
||||
// matching adhoc column labels, then uses adhoc_column_to_sqla
|
||||
// to emit the actual SQL expression into ORDER BY — so this
|
||||
// is dialect-safe across all database engines.
|
||||
return getColumnLabel(matchingColumn);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user