bito-code-review[bot] commented on PR #42318:
URL: https://github.com/apache/superset/pull/42318#issuecomment-5052748120

   <!-- Bito Reply -->
   To safely deduplicate errors that may contain `BigInt` values, you should 
use a custom replacer function in `JSON.stringify` that converts `BigInt` 
values to strings. This prevents the serialization error that occurs when 
`JSON.stringify` encounters a `BigInt`.
   
   Here is the updated implementation for the deduplication logic in 
`superset-frontend/src/SqlLab/components/ResultSet/index.tsx`:
   
   ```tsx
       const seenErrors = new Set<string>();
       const errors = [
         ...(query.extra?.errors || []),
         ...(query.errors || []),
       ].filter(error => {
         const key = JSON.stringify(error, (key, value) =>
           typeof value === 'bigint' ? value.toString() : value
         );
         if (seenErrors.has(key)) {
           return false;
         }
         seenErrors.add(key);
         return true;
       });
   ```
   
   **superset-frontend/src/SqlLab/components/ResultSet/index.tsx**
   ```
   const key = JSON.stringify(error, (key, value) =>
           typeof value === 'bigint' ? value.toString() : value
         );
   ```


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