michael-s-molina opened a new pull request, #38953:
URL: https://github.com/apache/superset/pull/38953

   ### SUMMARY
   
   Pivot Table was showing `0NaN` in column and row headers when using 
Date/Timestamp data because `dateFormatters` expect a `number` but were 
receiving a `string`.
   
   The original fix by @marcioibm in #38191 used a bare `Number()` cast, which 
returns `NaN` for non-numeric date strings like `'Dec. 16 2020'` or 
`'2024-01-15T00:00:00Z'`. This PR improves the fix by introducing a 
`convertToNumberIfNumeric` helper that only converts to a number when the 
string is genuinely numeric, and falls back to the original string otherwise.
   
   Credit to @marcioibm for the original fix and tests in #38191.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   See #38191 for before/after screenshots.
   
   ### TESTING INSTRUCTIONS
   
   1. Load default dev environment
   2. Create a Pivot Table chart with a timestamp/date column or row
   3. Verify dates display correctly and no `0NaN` appears
   4. Run unit tests: `npm run test -- 
plugins/plugin-chart-pivot-table/test/react-pivottable/tableRenders.test.tsx`
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
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]

Reply via email to