Skip to content

Unknown column used in orderby for SQL expression columns (server-side pagination) #37520

Description

@wuqicyber

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:

Image

This issue only occurs with server-side pagination enabled, where sorting is handled by the backend rather than the frontend.

Steps to Reproduce

  1. Create a table chart with server-side pagination enabled
  2. Add a custom SQL expression column:
Image 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

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions