Bug description
Summary
When using server-side pagination in a table chart and attempting to sort by a custom SQL expression column (adhoc column), the API returns a 400 error:
This issue only occurs with server-side pagination enabled, where sorting is handled by the backend rather than the frontend.
Steps to Reproduce
- Create a table chart with server-side pagination enabled
- Add a custom SQL expression column:

3. Click on the adhoc column header to sort by it
4. The API receives an orderby clause referencing the adhoc column by its label:
{
"orderby": [["new_rank_name", false]]
}
5. API returns 400 error
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.10
Node version
18 or greater
Browser
Chrome
Additional context
No response
Checklist
Bug description
Summary
When using server-side pagination in a table chart and attempting to sort by a custom SQL expression column (adhoc column), the API returns a 400 error:
This issue only occurs with server-side pagination enabled, where sorting is handled by the backend rather than the frontend.
Steps to Reproduce
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.10
Node version
18 or greater
Browser
Chrome
Additional context
No response
Checklist