Skip to content

【6.0.0-RC2】Sorting filter values by a metric doesn't work #35331

Closed

Description

@saghatelian

Bug description

I'm testing the version 6.0.0-RC2.
Sorting filter values by a metric doesn't work. Instead of sorting the values my the selected metric, it always sorts alphabetically. See the screenshots for comparison between version 4.1.1 and 6.0.0rc2 of the same filter on the same dashboard with the same setup (dark theme is the 6.0.0rc2).

Screenshots/recordings

Image Image Image Image

Superset version

master / latest-dev

Python version

Not applicable

Node version

Not applicable

Browser

Chrome

Additional context

My data source is BigQuery (not sure if it makes a difference).

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

  1. changed the title [-]Sorting filter values by a metric doesn't work[/-] [+]【6.0.0-RC2】Sorting filter values by a metric doesn't work[/+] on Sep 29, 2025
  2. dosubot commented on Sep 29, 2025

    @dosubot

    This is a confirmed regression: in Superset 6.0.0-RC2, select filter components always sorted values alphabetically in the frontend, even when a sort metric was specified, overriding the backend's metric-based sorting. This broke the expected behavior you saw in 4.1.1. The bug was fixed in pull request #35130 and pull request #35155, merged in September 2025. With these fixes, when you select a sort metric in the filter config, the frontend preserves the backend's metric-based order, and alphabetical sorting only applies if no metric is set.

    To resolve this, upgrade to a build that includes these fixes (post-September 18, 2025). Sorting by metric should then work as expected, regardless of your data source (BigQuery or otherwise), since the logic is datasource-agnostic and handled in the frontend/backend communication.

    Note: Sorting must be configured using the UI controls and the structured format; raw SQL strings for sorting are no longer supported in recent versions. If you need complex sorting, create a calculated column or metric first, then sort by that metric in the filter config. Details

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about superset with Dosu Add Dosu to your team

  3. added
    dashboard:filtersets
    on Sep 29, 2025
  4. rusackas commented on Sep 30, 2025

    @rusackas
    Member

    I guess I'm not sure how to validate this based on screenshot. Maybe you do have more signups in India than other countries?

    If you could do any/all of the following, it would help:

    • Provide an example of the regression using example datasets/dashboards
    • Provide a PR with a failing test, so we can write code TDD-style to fix it
    • Investigate/submit a fix PR :)
  5. saghatelian commented on Oct 6, 2025

    @saghatelian
    ContributorAuthor

    @rusackas thanks for the reply.
    Reading the (very useful) comment from @dosu , I concluded that the issue is resolved and merged into the 6.0-bug-fixes branch, and will make into RC3.

    As for demonstrating the issue: Sorry for not providing enough details. Yes, we indeed have more signups from India 🙂 , and the Superset 4.1.1 version sorts in correctly (the light theme on the screenshots). The 6.0.0rc2 version, on the other hand, sorts values alphabetically regardless of the chosen metric (the dark theme on the screenshots). If the issue is not resolved yet, and more proof is needed, I'll demonstrate it on an example dataset.

  6. dosubot commented on Oct 6, 2025

    @dosubot

    You're correct—the regression in filter value sorting by metric was fixed and merged into the 6.0-bug-fixes branch, and will be included in RC3. Once you upgrade to a build with these fixes, sorting by metric in filter controls should work as expected, regardless of your data source. No further demonstration is needed unless you encounter the issue again after RC3 is released. If that happens, feel free to share more details or examples for further investigation. Details on the fix

    To reply, just mention @dosu.


    Docs are dead. Just use Dosu.

    Leave Feedback Ask Dosu about superset Share Dosu with your team

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

Metadata

Metadata

Assignees

Labels

dashboard:filtersets

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions