Skip to content

fix(post-processing): handle missing values in cumulative operator - #26429

Merged
michael-s-molina merged 2 commits into
apache:masterfrom
villebro:villebro/fix-cumsum-gap
Jan 9, 2024
Merged

michael-s-molina merged 2 commits into
apache:masterfrom
villebro:villebro/fix-cumsum-gap

Conversation

@villebro

@villebro villebro commented Jan 9, 2024 •

Copy link
Copy Markdown
Member

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

@codecov

codecov Bot commented Jan 9, 2024 •

Copy link
Copy Markdown

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.

@kgabryje kgabryje left a comment

Copy link
Copy Markdown
Member

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
@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
Copy Markdown

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 Cherry-picked to 3.0.3 🍒 3.0.4 Cherry-picked to 3.0.4 🍒 3.1.0 Cherry-picked to 3.1.0 🍒 3.1.1 Cherry-picked to 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
@mistercrunch mistercrunch added 🍒 3.1.2 Cherry-picked to 3.1.2 🚢 4.0.0 First shipped in 4.0.0 labels Apr 17, 2024
@mistercrunch mistercrunch added the 🍒 3.1.3 Cherry-picked to 3.1.3 label Jul 2, 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 Cherry-picked to 3.0.3 🍒 3.0.4 Cherry-picked to 3.0.4 🍒 3.1.0 Cherry-picked to 3.1.0 🍒 3.1.1 Cherry-picked to 3.1.1 🍒 3.1.2 Cherry-picked to 3.1.2 🍒 3.1.3 Cherry-picked to 3.1.3 🚢 4.0.0 First shipped in 4.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cumsum Creating Discontinuous Lines

5 participants