aminghadersohi opened a new pull request, #44739:
URL: https://github.com/apache/superset/pull/44739
### SUMMARY
SQL Lab sends `Decimal` values as JSON numbers. Even when the JSON contains
all digits, JavaScript rounds them; reading the JSON result cache also loses
precision before CSV export.
Convert decimals to strings at the SQL Lab record boundary, shared by
synchronous results, JSON cache writes and Arrow-cache reads. Keep the
DataFrame and shared chart JSON serializer numeric. Sort decimal strings by
sign, decimal order and significand rather than `parseFloat`, including values
differing only in their 38th digit. API behavior is documented in UPDATING and
the user guide.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: `12345678901234567890.123456789012345678` is a JSON number and
rounds in the browser. After: the response contains the exact quoted value; the
grid displays it and sorts it numerically. A component test clicks the column
header and checks both directions.
### TESTING INSTRUCTIONS
- Backend dataframe tests: 20 pass; seven new cases fail before the change.
- FilterableTable/component/comparator Jest tests: 31 pass. The
exact-decimal component test and four comparator cases fail with the original
comparator.
- Live PostgreSQL 17 and Databricks: exact DECIMAL(38,18) through SQL Lab
HTTP, sync execution, JSON and Arrow caches, CSV exports; live chart SUM stays
numeric. The upstream implementation was run separately without a serialization
carry.
- Pre-commit checks pass except the full frontend type-check: this checkout
lacks generated workspace declaration outputs (`TS6305` for
`packages/*/lib/*.d.ts`). Comparator strict TypeScript compilation and the
component Jest tests pass. No dependency or lockfile changes.
To reproduce manually, execute `SELECT
CAST('12345678901234567890.123456789012345678' AS DECIMAL(38,18)) AS exact` in
SQL Lab, inspect the JSON response, sort nearby decimal values and export CSV.
Re-run old cached queries after upgrading workers.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [x] Changes UI
- [ ] Includes DB Migration
- [x] Introduces new feature or API: decimal response values become strings
- [ ] Removes existing feature or API
LLM assistance: Codex.
--
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]