Skip to content

[Bug] Regression in 5.0.0: TypeError "Cannot mix BigInt and other types" when rendering charts with large integers #36401

@jongkookson

Description

@jongkookson

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

Image Image

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.

Metadata

Metadata

Assignees

Labels

#bug:regressionBugs that are identified as regessionsvalidation:requiredA committer should validate the issueviz:charts:lineRelated to the Line chart

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions