piyushraj001 commented on code in PR #44044:
URL: https://github.com/apache/superset/pull/44044#discussion_r4079310430
##########
superset-frontend/plugins/plugin-chart-table/src/utils/formatValue.ts:
##########
@@ -51,12 +51,25 @@ function formatValue(
return [false, 'N/A'];
}
if (formatter) {
+ // Query results with integers beyond Number.MAX_SAFE_INTEGER are now
+ // parsed as decimal strings by parseResponse.ts (e.g.
"12345678901234567890").
+ // Accept both native bigint (legacy / direct callers) and decimal-integer
+ // strings. The /^-?\d+$/ guard is intentionally strict: floats, NaN,
+ // Infinity, scientific-notation strings, and pre-formatted values must
+ // NOT be coerced here — they flow through as-is so NumberFormatter can
+ // handle them with its own null/NaN/Infinity guards.
+ const numericValue: number =
+ typeof value === 'bigint'
+ ? Number(value)
+ : typeof value === 'string' && /^-?\d+$/.test(value)
+ ? Number(value)
+ : (value as number);
Review Comment:
Fair observation. The guard lives in formatValue.ts, getValueRange, and the
two cell-bar callsites in TableChart.tsx. Centralizing into a shared
toNumericValue helper is the right direction — will track as a follow-up to
avoid scope creep here.
--
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]