Skip to content

Add size check and adaptation to handle the changes in polars.hstack#2

Merged
mmantyla merged 2 commits intoEvoTestOps:mainfrom
rpessi:rpessi-patch-1
Feb 12, 2026
Merged

Add size check and adaptation to handle the changes in polars.hstack#2
mmantyla merged 2 commits intoEvoTestOps:mainfrom
rpessi:rpessi-patch-1

Conversation

@rpessi
Copy link
Copy Markdown
Contributor

@rpessi rpessi commented Feb 11, 2026

Refactor moving average calculation to handle empty DataFrame case.

Refactor moving average calculation to handle empty DataFrame case.
@mmantyla
Copy link
Copy Markdown
Contributor

mmantyla commented Feb 11, 2026

Thanks. The old code might not work with the more recent polars versions. Also the old is not really in Polars spirit. Perhaps while we are at it, you could update the pull request like this and test if it fixes the issue? This approach should also be faster but I have not tested it.

return df.select([
        pl.col(col).rolling_mean(window_size).alias(f"moving_avg_{window_size}_{col}")
        for col in numeric_cols

@rpessi
Copy link
Copy Markdown
Contributor Author

rpessi commented Feb 11, 2026

I updated with the suggested return statement, used my descretion to add the missing brackets.

@mmantyla mmantyla merged commit 5a73730 into EvoTestOps:main Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants