Bug description

When using Time comparison with cumulative post-processing, rows that exist only in the shifted period (e.g. 1 week ago) are lost if the current period has no data for the same day. This causes the cumulative curve to flatten (zero increment) on the current side and under-count on the shifted side.

using resample does not fix the problem because it's on the postproccesing .

Screenshots/recordings

Image

Superset version

master / latest-dev

Python version

3.10

Node version

18 or greater

Browser

Chrome

Additional context

No response

Checklist

  • [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Comment From: dosubot[bot]

This issue happens because, during time comparison, Superset joins the current and shifted dataframes using a left join keyed on the current period. If the current period has no data for a date, any rows that exist only in the shifted period are dropped at this stage. As a result, the cumulative post-processing step only sees the aligned dates, causing the shifted cumulative curve to undercount and misalign when the current period is missing data for those dates. The cumulative function itself fills NaNs with zero before summing, but it doesn't restore missing dates lost in the join. Using resample after the fact doesn't help, since the data is already lost by then. There are no configuration options or workarounds documented for this scenario, and no open or closed issues or PRs directly address this bug in the current codebase. The root cause is that the post-processing pipeline does not guarantee the union of all dates from both periods is preserved through to the cumulative calculation, so missing dates in the current period will always cause this misalignment in time-shifted cumulative charts reference.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X