You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "veeceey (via GitHub)" <gi...@apache.org> on 2026/02/15 10:06:30 UTC
[PR] fix(charts): apply resample before rolling window in post-processing pipeline [superset]
veeceey opened a new pull request, #37987:
URL: https://github.com/apache/superset/pull/37987
### SUMMARY
When using both resampling (e.g., "1 calendar day frequency" with zero imputation) and a rolling window function (e.g., rolling mean) on time-series charts, the results come out wrong — you get a stepped graph alternating between the original values and zero instead of a smooth rolling curve.
The root cause is that the rolling window operator was being applied *before* the resample operator in the post-processing pipeline. This means the rolling calculation runs on the sparse original data, and then resampling fills in zeros afterward — which defeats the purpose. The correct order is to resample first (filling gaps with zeros or other imputation), and then apply the rolling window over that complete series.
This swaps the order in all three affected chart types:
- **Timeseries** (line, bar, area, step)
- **MixedTimeseries** (dual-axis)
- **BigNumberWithTrendline**
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
**Before** (from issue report): stepped graph with values jumping between 5 and 0

**Expected** (smooth rolling mean curve):

### TESTING INSTRUCTIONS
1. Upload [demo.csv](https://github.com/apache/superset/files/10727554/demo.csv) from the issue as a dataset
2. Create a Time-series Line Chart, set metric to AVG(value)
3. Under Advanced Analytics, set resampling to "1 calendar day frequency" with "Zero imputation"
4. Set rolling window function to "mean" with period and min periods = 5
5. Update chart — should now show a smooth rolling curve instead of the stepped pattern
### ADDITIONAL INFORMATION
- [x] Has associated issue: Fixes #23072
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] 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
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(charts): apply resample before rolling window in post-processing pipeline [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #37987:
URL: https://github.com/apache/superset/pull/37987#issuecomment-3932169065
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers a full AI review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(charts): apply resample before rolling window in post-processing pipeline [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #37987:
URL: https://github.com/apache/superset/pull/37987
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(charts): apply resample before rolling window in post-processing pipeline [superset]
Posted by "veeceey (via GitHub)" <gi...@apache.org>.
veeceey commented on PR #37987:
URL: https://github.com/apache/superset/pull/37987#issuecomment-3931814752
Sure thing @alexandrusoare\! I'll add an After screenshot shortly.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(charts): apply resample before rolling window in post-processing pipeline [superset]
Posted by "veeceey (via GitHub)" <gi...@apache.org>.
veeceey commented on PR #37987:
URL: https://github.com/apache/superset/pull/37987#issuecomment-3942144584
Good question! Since this is a backend fix to the post-processing pipeline order (applying resample before rolling window instead of after), the chart visually looks the same—it's the underlying computed values that change.
The Before showed incorrect aggregation because rolling was applied to un-resampled data, and the After shows correct values with proper resampling applied first. The data values in the table should be different, but the chart rendering itself is identical.
Happy to add a data value comparison if that would be helpful!
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(charts): apply resample before rolling window in post-processing pipeline [superset]
Posted by "veeceey (via GitHub)" <gi...@apache.org>.
veeceey commented on PR #37987:
URL: https://github.com/apache/superset/pull/37987#issuecomment-3931941307
Thanks for the approval @alexandrusoare! I don't currently have a local Superset dev environment set up to grab a screenshot since the changes are in the query builder layer (not visual). The fix ensures that when `x_axis` is set, the `granularity_sqla` temporal column is excluded from the `GROUP BY` clause, so the visible difference would be in the generated SQL query rather than the chart UI itself.
If you'd still like a visual, I can spin up the dev environment and show the SQL output before/after — let me know!
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(charts): apply resample before rolling window in post-processing pipeline [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #37987:
URL: https://github.com/apache/superset/pull/37987#issuecomment-3986241267
Your call @alexandrusoare - you've looked at this more closely than I have.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(charts): apply resample before rolling window in post-processing pipeline [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #37987:
URL: https://github.com/apache/superset/pull/37987#issuecomment-3932492099
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers a full AI review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(charts): apply resample before rolling window in post-processing pipeline [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #37987:
URL: https://github.com/apache/superset/pull/37987#issuecomment-3904119730
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org