jongkookson opened a new issue, #36401:
URL: https://github.com/apache/superset/issues/36401

   ### Bug description
   
   **Describe the bug**
   When visualizing data that contains large integer values, the frontend 
throws a `TypeError: Cannot mix BigInt and other types.`
   
   It seems that Superset correctly identifies these large numbers as BigInt in 
the data fetching layer, but the visualization library (ECharts) or the 
transformation layer attempts to mix these BigInt values with standard Number 
types during rendering, causing the crash.
   
   **This issue was NOT present in Superset version 4.1.4 (and earlier). It 
appears to be a regression introduced in version 5.0.0.**
   
   
   **Reproduction Steps**
   
   1.  Go to **SQL Lab**.
   2.  Select a database (e.g., PostgreSQL).
   3.  Run the following query to generate virtual data with large integers 
(approx. 9\~10 quadrillion):
       ```sql
       SELECT '2025-01-01'::date date_key, 10402176025875170 a, 
9182221549972519 b
       UNION ALL
       SELECT '2025-01-02'::date date_key, 290783677762650 a, 9915708291358753 b
       ```
   4.  Click **Create Chart** and select **Line Chart** (or Bar Chart).
   5.  Set **X-axis** to `date_key`.
   6.  Set **Metrics** to `sum(a)` and `sum(b)`.
   7.  With these settings, the generated query looks like this:
       ```sql
       SELECT
           date_key AS date_key,
           sum(a) AS "sum(a)",
           sum(b) AS "sum(b)"
       FROM (
           SELECT '2025-01-01'::date date_key, 10402176025875170 a, 
9182221549972519 b
           UNION ALL
           SELECT '2025-01-02'::date date_key, 290783677762650 a, 
9915708291358753 b
       ) AS virtual_table
       GROUP BY date_key
       ORDER BY "sum(a)" DESC
       LIMIT 1000;
       ```
   8.  Click **Update Chart**.
   9.  Observe the error.
   
   **Expected behavior**
   The chart should render correctly, similar to how it behaved in version 
4.1.4. The frontend should ideally cast BigInt to Number automatically (even 
with a precision loss warning) or handle large integers gracefully within the 
visualization library, rather than crashing the entire component.
   
   ### Screenshots/recordings
   
   
   <img width="1910" height="798" alt="Image" 
src="https://github.com/user-attachments/assets/2591d27d-9ff6-40ba-9c59-39ce2c4fc955";
 />
   
   <img width="1909" height="912" alt="Image" 
src="https://github.com/user-attachments/assets/7419de76-6bf2-46f7-b7af-166b4ca1ebdf";
 />
   
   
   ### Superset version
   
   5.0.0
   
   ### Python version
   
   3.10
   
   ### Node version
   
   I don't know
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [x] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


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