sadpandajoe commented on code in PR #42596:
URL: https://github.com/apache/superset/pull/42596#discussion_r3684923461
##########
superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx:
##########
@@ -720,6 +720,80 @@ describe('SelectFilterPlugin', () => {
expect(options[2]).toHaveTextContent('beta');
});
+ test('sorts numeric filter values numerically, not lexicographically, when
no sortMetric is specified', () => {
+ // Regression for #36775: numeric filter values were sorted as strings
+ // (localeCompare on the formatted label), producing "1, 10, 100, 2"
+ // instead of the expected "1, 2, 10, 100".
+ const testData = [{ age: 10 }, { age: 2 }, { age: 100 }];
Review Comment:
Confirmed — the failing Jest shard reproduces this exactly: the first option
is `10` rather than `2` because the current comparator sorts the formatted
labels. The production comparator fix needs to land with this regression test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]