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: big number with trendline can't calculate cumsum #19542

Merged
merged 1 commit into from
Apr 6, 2022

Conversation

zhaoyongjie
Copy link
Member

@zhaoyongjie zhaoyongjie commented Apr 6, 2022

SUMMARY

This PR fixed that the Big Number with Trendline can't calculate with cumsum. In addition, I moved the Resample panel into the chart.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before

image

After

image

TESTING INSTRUCTIONS

  1. Select the cleaned_sales_data dataset and the Big Number with Trendline Chart
  2. Set:
    a. order date as the TIME COLUMN.
    b. Month as the TIME GRAIN.
    c. COUNT(*) as the METRIC.
    d. cumsum as the ROLLING FUNCTION.
  3. Click on RUN.

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

Comment on lines -30 to -50
const TIME_GRAIN_MAP: Record<string, string> = {
PT1S: 'S',
PT1M: 'min',
PT5M: '5min',
PT10M: '10min',
PT15M: '15min',
PT30M: '30min',
PT1H: 'H',
P1D: 'D',
P1M: 'MS',
P3M: 'QS',
P1Y: 'AS',
// TODO: these need to be mapped carefully, as the first day of week
// can vary from engine to engine
// P1W: 'W',
// '1969-12-28T00:00:00Z/P1W': 'W',
// '1969-12-29T00:00:00Z/P1W': 'W',
// 'P1W/1970-01-03T00:00:00Z': 'W',
// 'P1W/1970-01-04T00:00:00Z': 'W',
};

Copy link
Member Author

Choose a reason for hiding this comment

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

Use explicit the Resample control to select.

@codecov
Copy link

codecov bot commented Apr 6, 2022

Codecov Report

Merging #19542 (97615ba) into master (1b4d8dd) will increase coverage by 0.00%.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##           master   #19542   +/-   ##
=======================================
  Coverage   66.59%   66.60%           
=======================================
  Files        1682     1682           
  Lines       64314    64316    +2     
  Branches     6559     6560    +1     
=======================================
+ Hits        42832    42836    +4     
+ Misses      19781    19779    -2     
  Partials     1701     1701           
Flag Coverage Δ
javascript 51.37% <0.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...src/BigNumber/BigNumberWithTrendline/buildQuery.ts 0.00% <0.00%> (-11.12%) ⬇️
.../BigNumber/BigNumberWithTrendline/controlPanel.tsx 33.33% <ø> (ø)
...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx 80.95% <0.00%> (-3.26%) ⬇️
...c/filters/components/Select/SelectFilterPlugin.tsx 64.10% <0.00%> (-0.38%) ⬇️
superset-frontend/src/views/CRUD/hooks.ts 46.36% <0.00%> (ø)
...uperset-frontend/src/components/FaveStar/index.tsx 100.00% <0.00%> (ø)
...-frontend/src/components/AlteredSliceTag/index.jsx 87.87% <0.00%> (ø)
superset-frontend/src/views/CRUD/utils.tsx 66.12% <0.00%> (+0.55%) ⬆️
...rc/explore/components/ExploreChartHeader/index.jsx 42.10% <0.00%> (+1.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b4d8dd...97615ba. Read the comment docs.

@zhaoyongjie zhaoyongjie requested a review from a team April 6, 2022 07:48
@stephenLYZ
Copy link
Member

Tested in local and LGTM.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix and the testing instructions, they really make validation so much easier 👍

@villebro villebro added the v1.5 label Apr 6, 2022
@zhaoyongjie zhaoyongjie merged commit 2daa071 into apache:master Apr 6, 2022
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Apr 6, 2022
@sadpandajoe
Copy link
Member

🏷️ preset:2022.13

villebro pushed a commit that referenced this pull request Apr 8, 2022
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
@mistercrunch mistercrunch added 🍒 1.5.0 🍒 1.5.1 🍒 1.5.2 🍒 1.5.3 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 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 preset:2022.13 size/L 🍒 1.5.0 🍒 1.5.1 🍒 1.5.2 🍒 1.5.3 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants