bito-code-review[bot] commented on code in PR #42596:
URL: https://github.com/apache/superset/pull/42596#discussion_r3711017312
##########
superset-frontend/packages/superset-ui-core/src/components/Select/utils.tsx:
##########
@@ -91,6 +91,18 @@ export const propertyComparator =
if (typeof propertyA === 'number' && typeof propertyB === 'number') {
return propertyA - propertyB;
}
+ // BIGINT columns can decode to native `bigint` values (see json-bigint
+ // parsing of large numeric values). Compare numerically rather than
+ // falling through to the string fallback below, which would sort them
+ // lexicographically (e.g. "10", "100", "2").
+ if (
+ (typeof propertyA === 'bigint' || typeof propertyA === 'number') &&
+ (typeof propertyB === 'bigint' || typeof propertyB === 'number')
+ ) {
+ if (propertyA < propertyB) return -1;
+ if (propertyA > propertyB) return 1;
+ return 0;
+ }
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Missing bigint test coverage</b></div>
<div id="fix">
The new bigint comparison block (lines 98-105) lacks test coverage in
`utils.test.ts`, which only tests string-parsing utilities. Without tests,
future refactors could silently break bigint sorting (e.g., reverting to
lexicographic "10, 100, 2").
</div>
</div>
<small><i>Code Review Run #c66c9e</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]