Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: `rolling_*_by was throwing incorrect error when dataframe was sorted by contained multiple chunks #16247

Merged
merged 1 commit into from
May 16, 2024

Conversation

MarcoGorelli
Copy link
Collaborator

@MarcoGorelli MarcoGorelli commented May 15, 2024

closes #16246

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels May 15, 2024
@@ -82,6 +82,7 @@ where
return Ok(Series::new_empty(ca.name(), ca.dtype()));
}
let ca = ca.rechunk();
let by = by.rechunk();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error comes from L112

    let by_values = by.cont_slice().map_err(|_| {
        polars_err!(
            ComputeError:
            "`by` column should not have null values in 'rolling by' expression"
        )
    })?;

The values already get re-chunked, so the by ones probably should too?

Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.86%. Comparing base (5b77f01) to head (8aa2d87).
Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16247      +/-   ##
==========================================
- Coverage   81.04%   80.86%   -0.18%     
==========================================
  Files        1392     1394       +2     
  Lines      178931   179489     +558     
  Branches     2907     2913       +6     
==========================================
+ Hits       145014   145145     +131     
- Misses      33411    33841     +430     
+ Partials      506      503       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MarcoGorelli MarcoGorelli marked this pull request as ready for review May 15, 2024 18:37
@ritchie46 ritchie46 merged commit a743934 into pola-rs:main May 16, 2024
26 checks passed
Wouittone pushed a commit to Wouittone/polars that referenced this pull request Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect `by column should not have null values in 'rolling by' expression` error
2 participants