-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Description
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
- Go to SQL Lab.
- Select a database (e.g., PostgreSQL).
- Run the following query to generate virtual data with large integers (approx. 9~10 quadrillion):
SELECT '2025-01-01'::date date_key, 10402176025875170 a, 9182221549972519 b UNION ALL SELECT '2025-01-02'::date date_key, 290783677762650 a, 9915708291358753 b
- Click Create Chart and select Line Chart (or Bar Chart).
- Set X-axis to
date_key. - Set Metrics to
sum(a)andsum(b). - With these settings, the generated query looks like this:
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;
- Click Update Chart.
- 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
Superset version
5.0.0
Python version
3.10
Node version
I don't know
Browser
Chrome
Additional context
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.
Checklist
- I have searched Superset docs and Slack and didn't find a solution to my problem.
- I have searched the GitHub issue tracker and didn't find a similar bug report.
- 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.