sadpandajoe commented on code in PR #42596:
URL: https://github.com/apache/superset/pull/42596#discussion_r3707756295


##########
superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx:
##########
@@ -354,14 +354,20 @@ export default function PluginFilterSelect(props: 
PluginFilterSelectProps) {
         return 0; // Preserve the original order from the backend
       }
 
-      // Only apply alphabetical sorting when no sortMetric is specified
-      const labelComparator = propertyComparator('label');
+      // Only apply sorting when no sortMetric is specified. `label` is always
+      // a formatted string (see getDataRecordFormatter), so comparing by it
+      // never reaches propertyComparator's numeric branch; numeric columns
+      // sort by the raw `value` instead so "2, 10, 100" doesn't collapse
+      // into lexicographic "10, 100, 2".
+      const comparator = propertyComparator(
+        datatype === GenericDataType.Numeric ? 'value' : 'label',

Review Comment:
   Numeric filter values stored as `bigint` still take `propertyComparator`’s 
string fallback, so values like 2n, 10n, and 100n remain ordered as 10, 100, 2. 
Should the numeric branch handle bigint values too?



-- 
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]

Reply via email to