fix(STEF-2802): skip RollingAggregatesAdder when no aggregation functions#813
Merged
egordm merged 1 commit intorelease/v4.0.0from Feb 20, 2026
Merged
Conversation
…ions When rolling_aggregate_features is empty (e.g., ato_regions, grid_losses), the RollingAggregatesAdder transform is no longer added to the pipeline. Previously it was always added, and fit() would crash with ValueError: No objects to concatenate when calling pandas rolling().agg([]). Signed-off-by: Egor Dmitriev <egor.dmitriev@alliander.com>
a2101df to
955dc66
Compare
JanMaartenvanDoorn
requested changes
Feb 20, 2026
Member
JanMaartenvanDoorn
left a comment
There was a problem hiding this comment.
Looks like a good fix! Do you want to add a test to lock in this behavior?
bartpleiter
approved these changes
Feb 20, 2026
Collaborator
Author
|
@JanMaartenvanDoorn Not sure. We didn't add tests on presets cause they deem as kind of configurations. Making tests on those might make them too specific to certain defaults which might change. |
JanMaartenvanDoorn
approved these changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
`RollingAggregatesAdder` is always added to the forecasting workflow pipeline, even when `rolling_aggregate_features` is empty (e.g., for ato_regions and grid_losses origins). While `transform()` has an early-return guard for empty aggregation functions, `fit()` does not — causing `pandas.rolling().agg([])` to raise `ValueError: No objects to concatenate`.
Fix
Conditionally add `RollingAggregatesAdder` to the feature_adders list in `create_forecasting_workflow()` only when `config.rolling_aggregate_features` is non-empty. When empty, the transform is simply not created, avoiding the crash entirely.
Impact