kokhlo opened a new pull request, #44701: URL: https://github.com/apache/superset/pull/44701
### SUMMARY Fixes #44698 (claim comment with the full RCA: https://github.com/apache/superset/issues/44698#issuecomment-5845412319) On a temporal x-axis with **no time grain** (e.g. the bundled *Top 10 Games* example, whose temporal `year` BIGINT column is used directly with no `time_grain_sqla`), the last axis label renders as `.943ms` instead of a year. Root cause chain, verified on main: 1. `getXAxisFormatter(xAxisTimeFormat, resolvedTimeGrain)` → with no grain, `getSmartDateFormatter(undefined)` returns the **raw** `smart_date` formatter — the `setMilliseconds(0)` normalization exists only inside the grain-aware wrapper (`plugins/plugin-chart-echarts/src/utils/formatters.ts`). 2. `smart_date`'s finest tier is `millisecond: '.%Lms'` (`packages/superset-ui-core/src/time-format/formatters/smartDate.ts`). 3. ECharts pads the time-axis extent past the last data point, and the forced `showMaxLabel` boundary label formats the padded value — which carries sub-second noise. Confirmed against the repo's own echarts: the forced max label receives values like `2009-01-01T00:00:00.943Z`, rendering `.943ms` while every real tick is a clean year. This regressed when #38017/#41350 replaced #38083's grain-agnostic floor-to-second axis wrapper with the grain-aware normalizer — the no-grain path lost the protection. ### BEFORE/AFTER - before: `formatter(new Date('2009-01-01T00:00:00.943Z'))` → `".943ms"` - after: → `"2009"` (identical to the clean `2009-01-01T00:00:00Z` tick) ### TESTING - new regression test in `test/utils/formatters.test.ts`: RED on main (`.943ms` vs `2009`), GREEN with the fix - full local gates: `formatters.test.ts` 24 passed, `test/Timeseries` 14 suites / 384 passed, `test/MixedTimeseries` 4 suites / 65 passed, oxfmt + oxlint clean ### ADDITIONAL INFORMATION - [x] Has associated issue: #44698 - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration - [ ] Commits are prefixed per repo convention - [ ] Includes documentation - [ ] Adds UI tests -- 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]
