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: Crash using empty Series in LazyFrame.select() #16592

Merged
merged 1 commit into from
May 30, 2024

Conversation

nameexhaustion
Copy link
Collaborator

@nameexhaustion nameexhaustion commented May 30, 2024

Fixes #16577

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels May 30, 2024
@@ -456,7 +456,7 @@ impl Hash for LiteralValue {
s.null_count().hash(state);
const RANDOM: u64 = 0x2c194fa5df32a367;
let mut rng = (len as u64) ^ RANDOM;
for _ in 0..5 {
for _ in 0..std::cmp::min(5, len) {
Copy link
Collaborator Author

@nameexhaustion nameexhaustion May 30, 2024

Choose a reason for hiding this comment

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

This adds back the cmp::min. But if we want I can also do if len == 0 { return }, difference is just the number of hash steps for series with length 0 < n < 5.

Copy link

codecov bot commented May 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.51%. Comparing base (84ba2d0) to head (f54eec5).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #16592   +/-   ##
=======================================
  Coverage   81.50%   81.51%           
=======================================
  Files        1414     1414           
  Lines      185669   185697   +28     
  Branches     3003     3003           
=======================================
+ Hits       151334   151375   +41     
+ Misses      33818    33805   -13     
  Partials      517      517           

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

@ritchie46 ritchie46 merged commit aa771aa into pola-rs:main May 30, 2024
28 checks passed
@nameexhaustion nameexhaustion deleted the empty-sel branch May 30, 2024 08:41
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.

In LazyFrame, select empty Series causes panic
2 participants