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(post-processing): handle missing values in cumulative operator #26429

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

villebro
Copy link
Member

@villebro villebro commented Jan 9, 2024

SUMMARY

If your data contains nulls, using the cumsum operator will cause gaps in the chart. This is because null values appear as nulls in the series instead of the cumulative value. To avoid this, we replace nulls with zeros before applying the operator, ensuring that all values are present in the series.

AFTER

Now gaps in the data won't cause the bar to be truncated:
image

BEFORE

Previously, missing values would cause the cumulative series to be missing in the chart, causing gaps in the graph:
image

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue: closes Cumsum Creating Discontinuous Lines #21093
  • 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

Copy link

codecov bot commented Jan 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4c2e818) 69.16% compared to head (7f5039f) 69.16%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #26429      +/-   ##
==========================================
- Coverage   69.16%   69.16%   -0.01%     
==========================================
  Files        1948     1948              
  Lines       76042    76054      +12     
  Branches     8493     8493              
==========================================
+ Hits        52593    52601       +8     
- Misses      21269    21273       +4     
  Partials     2180     2180              
Flag Coverage Δ
hive 53.68% <0.00%> (-0.01%) ⬇️
mysql 78.07% <0.00%> (-0.01%) ⬇️
postgres 78.17% <0.00%> (-0.01%) ⬇️
presto 53.63% <0.00%> (-0.01%) ⬇️
python 82.85% <100.00%> (-0.01%) ⬇️
sqlite 77.76% <0.00%> (-0.01%) ⬇️
unit 55.86% <100.00%> (+0.06%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

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

LGTM

@michael-s-molina michael-s-molina merged commit ff025b7 into apache:master Jan 9, 2024
35 checks passed
@michael-s-molina michael-s-molina added v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch labels Jan 9, 2024
michael-s-molina pushed a commit that referenced this pull request Jan 9, 2024
michael-s-molina pushed a commit that referenced this pull request Jan 9, 2024
@villebro villebro deleted the villebro/fix-cumsum-gap branch January 9, 2024 16:41
josedev-union pushed a commit to Ortege-xyz/studio that referenced this pull request Jan 22, 2024
@JohnDietrich-Pepper
Copy link

Ah this fix really broke our charting. We wanted to show discontinuous lines when the data is null because the data is null and NOT zero particularly when the time period hasn't occurred yet. Now Superset is assuming all null data is zero which is not the case.
@villebro @rusackas

@mistercrunch mistercrunch added 🍒 3.0.3 🍒 3.0.4 🍒 3.1.0 🍒 3.1.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Mar 8, 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/S v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch 🍒 3.0.3 🍒 3.0.4 🍒 3.1.0 🍒 3.1.1 🍒 3.1.2 🚢 4.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cumsum Creating Discontinuous Lines
5 participants