Files
superset2/superset-frontend/plugins/plugin-chart-pivot-table/test
Joe Li 4b7283e3b8 fix(pivot-table): guard convertToNumberIfNumeric against non-string Date values
When temporal columns are used in pivot table Rows/Columns, Date objects
can reach convertToNumberIfNumeric at runtime despite the string[] type
declaration (due to any-typed boundaries in the data pipeline). Calling
.trim() on a Date object throws TypeError: t.trim is not a function,
crashing the chart entirely.

Widen the parameter type to unknown and add a type guard that returns
non-string values unchanged, letting the date formatter receive them
directly. Also update makeColPivotSettings test helper to accept unknown
and add regression tests for the Date object passthrough paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 09:51:49 -07:00
..