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: Fix filter scalar nulls #19786

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fix: Fix filter scalar nulls #19786

wants to merge 1 commit into from

Conversation

ritchie46
Copy link
Member

fixes #19771

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Nov 14, 2024
@@ -280,6 +280,11 @@ impl SeriesTrait for NullChunked {
// We still allow a length of `1` because it could be `lit(true)`.
polars_ensure!(filter.len() <= 1, ShapeMismatch: "filter's length: {} differs from that of the series: 0", filter.len());
0
} else if filter.len() == 1 {
return match filter.get(0) {
None | Some(true) => Ok(self.clone().into_series()),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe that None should be in the false branch, not behave like true.

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.

A no-op filter errors when the dataframe has an all null column
2 participants