fix(table-chart): support orderby adhoc columns with server-side pagination - #37521
Conversation
Code Review Agent Run #737cc3Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
…side-pagination' into fix/orderby-adhoc-column-server-side-pagination
Code Review Agent Run #873428Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #37521 +/- ##
==========================================
+ Coverage 60.48% 66.58% +6.09%
==========================================
Files 1931 643 -1288
Lines 76236 49053 -27183
Branches 8568 5502 -3066
==========================================
- Hits 46114 32661 -13453
+ Misses 28017 15097 -12920
+ Partials 2105 1295 -810
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
🎪 Showtime deployed environment on GHA for 1521ab1 • Environment: http://35.89.228.163:8080 (admin/admin) |
SBIN2010
left a comment
There was a problem hiding this comment.
LGTM! Thank you for your contribution!
During manual testing, everything works correctly.
…e chart
When a column label is renamed in the Table chart (e.g. 'CustomerID' to
'Id'), the search filter sends the display label ('Id') but the backend
columns_by_name dict is keyed by physical column names. This causes the
filter to be silently rejected with 'not_in_datasource'.
Add a fallback that resolves the filter column against adhoc_columns_by_label
(the same pattern used by PR apache#37521 for ORDER BY). Also update the
rejected/applied filter columns computation to recognize adhoc column labels.
Fixes apache#38339
SUMMARY
When using server-side pagination in table charts, sorting by custom SQL expression columns (adhoc columns) fails with:
Error: Unknown column used in orderby: <column_label>
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:


After:
ROOT CAUSE
In superset/models/helpers.py, the orderby validation loop (lines ~2767-2810) handles:
However, it does NOT handle adhoc columns (SQL expression columns with expressionType: "SQL"). When the orderby value is a string label that matches an adhoc column, the code fails to recognize it and raises QueryObjectValidationError.
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION