Bug description
The version is 6.0.0rc1 (but it was the same in 5)
The order of int values is incorrect:
as far as it's Int type, I expect: 1,2,3...
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.9
Node version
16
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.
Comment From: dosubot[bot]
This sorting issue happens because filter values in Superset dropdowns are often sorted as strings, not numbers, so you get lexicographical order (e.g., 1, 10, 2, 20) instead of numeric order (1, 2, 10, 20). The sorting logic for filter dropdowns is handled in the frontend, especially in Select filter components and their helpers. There isn't currently a built-in numeric sort for integer filter values—recent changes have focused on disabling frontend sorting for some dropdowns or using custom comparators for specific cases, but not for general numeric sorting in filters. This means integer values will not be sorted numerically by default in the filter UI unless custom logic is added in the frontend codeexample.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Comment From: stanislav-dombrovskiy-dp
In some old versions like 2.0.1 everything works as expected
Comment From: rusackas
Will try to reproduce, but it seems these are being sorted alphabetically as the bot surmised. Maybe we can figure out if the field type is numeric or string and sort accordingly? PR welcomed if you want to investigate/fix.
Comment From: rusackas
Actually, this should fix it: https://github.com/apache/superset/pull/34858
Can you investigate to see if it indeed does (on master
)? It'll be in RC2 :)