rusackas opened a new pull request, #42594:
URL: https://github.com/apache/superset/pull/42594
### SUMMARY
This is a **test-only PR** opened as a TDD-style validation of issue #36401.
#36401 (filed 2026, regression since 5.0.0) reports `TypeError: Cannot mix
BigInt and other types` thrown when rendering a stacked Line/Bar chart on data
containing very large integers. Query results with integers beyond
`Number.MAX_SAFE_INTEGER` are parsed as native `BigInt`
(`packages/superset-ui-core/src/connection/callApi/parseResponse.ts`, used via
`parseMethod: 'json-bigint'` on chart data fetches). `extractDataTotalValues`
in `plugins/plugin-chart-echarts/src/utils/series.ts` computes each stacked
bucket's total by summing datum values into a plain `0` Number accumulator
(`prev + (value as number)`) — this throws as soon as one metric value in the
reduce is a BigInt.
This PR adds two regression tests on `extractDataTotalValues`:
1. **`sums numeric metric values across a stacked datum`** — baseline sanity
check that normal-number stacking still totals correctly.
2. **`does not throw when a stacked datum contains a BigInt metric value`**
— regression for #36401. Currently fails on master.
### How to interpret CI
- **CI green** → the BigInt/Number mixing bug in `extractDataTotalValues`
has been fixed; merging closes #36401.
- **CI red** → bug is still live, exactly as it reproduces locally right
now. Fix belongs in `extractDataTotalValues`
(`plugins/plugin-chart-echarts/src/utils/series.ts:429-438`) — normalize the
accumulator/datum value to a common numeric representation (e.g. convert BigInt
values via `Number()` when finite-safe, or accumulate in BigInt and convert
once at the end) before summing.
### TESTING INSTRUCTIONS
```bash
cd superset-frontend
npx jest plugins/plugin-chart-echarts/test/utils/series.test.ts -t
"extractDataTotalValues"
```
Locally, the second test fails with:
```
TypeError: Cannot mix BigInt and other types, use explicit conversions
at plugins/plugin-chart-echarts/src/utils/series.ts:437:20
```
### ADDITIONAL INFORMATION
- [x] Has associated issue: closes #36401
- [ ] Required feature flags
- [ ] Changes UI
- [ ] Includes DB Migration
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
**Pre-commit note:** `custom-rules-frontend` and `type-checking-frontend`
were skipped locally (`SKIP=` in this worktree) — both fail on missing build
artifacts a fresh git worktree doesn't have (`glob` module not found;
`tscw-config` not installed), unrelated to this diff. `prettier`, `oxlint`, and
`stylelint` all passed locally. Trusting CI as the real gate for those two.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]