piyushraj001 commented on code in PR #44044:
URL: https://github.com/apache/superset/pull/44044#discussion_r4079303279


##########
superset-frontend/packages/superset-ui-core/src/connection/callApi/parseResponse.ts:
##########
@@ -61,8 +61,13 @@ export default async function parseResponse<T extends 
ParseMethod = 'json'>(
         (value?.isGreaterThan?.(Number.MAX_SAFE_INTEGER) ||
           value?.isLessThan?.(Number.MIN_SAFE_INTEGER))
       ) {
-        // toFixed() avoids scientific notation, which BigInt() rejects.
-        return BigInt(value.toFixed());
+        // Return as a decimal string to preserve full precision without
+        // producing a native bigint, which JSON.stringify cannot serialize
+        // (crashes ag-Grid, Redux DevTools, clipboard copy, and any other
+        // downstream consumer that calls JSON.stringify on result rows).
+        // bignumber.js .toFixed() always returns a non-scientific decimal
+        // string for integers, regardless of magnitude, so this is safe.
+        return value.toFixed();

Review Comment:
   The propertyComparator bigint branch in Select/utils.tsx is pre-existing 
code, unchanged by this PR. The finestTemporalGrain.ts bigint branch is now 
unreachable since parseResponse.ts no longer emits native bigint — but the 
decimal-string branch we added remains necessary. Removing the dead typeof 
value === 'bigint' guards is a clean-up worth doing, just in a follow-up to 
keep this PR focused on the crash fix.



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