dosubot[bot] commented on issue #34518: URL: https://github.com/apache/superset/issues/34518#issuecomment-3146512557
<!-- Answer --> 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 ca lculation, so missing dates in the current period will always cause this misalignment in time-shifted cumulative charts [reference](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/common/query_context_processor.py). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/2022a6d2-2f65-4314-ac10-d04d75e3d3f8?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/2022a6d2-2f65-4314-ac10-d04d75e3d3f8?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/2022a6d2-2f65-4314-ac10-d04d75e3d3f8?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/2022a6d2-2f65-4314-ac10-d04d75e3d3f8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/2022a6d2-2f65-4314-ac10-d04d75e3d3f8?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/2022a6d2-2f65-4314-ac10-d04d75e3d3f8?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/2022a6d2-2f65-4314-ac10-d04d75e3d3f8?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu b) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/34518) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
