Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(plugin-chart-pivot-table): Invalid Formats Date Fields #20909

Merged

Conversation

justinpark
Copy link
Member

@justinpark justinpark commented Jul 28, 2022

SUMMARY

When a custom date field value converted in a string format, some aggregators truncated to the first four digits.
This is caused by the parseFloat function which converts to first matched number rather than NaN (Not-A-Number) value.
This commit replaces the parseFloat by Number wrapper to handle this case correctly.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

Screen_Shot_2022-07-28_at_3_28_39_PM

After:

Screen_Shot_2022-07-28_at_3_32_41_PM

TESTING INSTRUCTIONS

storybook

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

When a custom date field value converted in a string format, some aggregators truncated to the first four digits.
 This is caused by the parseFloat function which converts to first matched number rather than NaN(Not-A-Number) value.
 This commit replaces the parseFloat by Number wrapper to handle this case correctly.
Copy link
Member

@ktmud ktmud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding a storybook!

@codecov
Copy link

codecov bot commented Jul 28, 2022

Codecov Report

Merging #20909 (c48afc0) into master (d50784d) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##           master   #20909   +/-   ##
=======================================
  Coverage   66.21%   66.21%           
=======================================
  Files        1758     1758           
  Lines       67009    67009           
  Branches     7107     7107           
=======================================
  Hits        44369    44369           
  Misses      20818    20818           
  Partials     1822     1822           
Flag Coverage Δ
javascript 52.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...hart-pivot-table/src/react-pivottable/utilities.js 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us.

@john-bodley john-bodley merged commit 3f124d9 into apache:master Jul 29, 2022
justinpark added a commit to airbnb/superset-fork that referenced this pull request Jul 29, 2022
)

When a custom date field value converted in a string format, some aggregators truncated to the first four digits.
 This is caused by the parseFloat function which converts to first matched number rather than NaN(Not-A-Number) value.
 This commit replaces the parseFloat by Number wrapper to handle this case correctly.
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants