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 nullable filter mask in group_by #11207

Merged
merged 1 commit into from
Sep 20, 2023
Merged

Conversation

reswqa
Copy link
Collaborator

@reswqa reswqa commented Sep 20, 2023

This fixes #11204.

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Sep 20, 2023
@@ -73,7 +73,7 @@ impl PhysicalExpr for FilterExpr {
let predicate = predicate_s.bool()?;

// All values true - don't do anything.
if predicate.all() {
if let Some(true) = predicate.all_kleene() {
Copy link
Collaborator Author

@reswqa reswqa Sep 20, 2023

Choose a reason for hiding this comment

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

If predicate only has null and true, all will return true and return the non-filtered series directly, this looks a bit strange. IIUC, value masked by None should also be filtered out. WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

We should do the same as in the select context. I see that we only return the true values there. So yes this seems correct.

@reswqa reswqa marked this pull request as ready for review September 20, 2023 07:34
@@ -73,7 +73,7 @@ impl PhysicalExpr for FilterExpr {
let predicate = predicate_s.bool()?;

// All values true - don't do anything.
if predicate.all() {
if let Some(true) = predicate.all_kleene() {
Copy link
Member

Choose a reason for hiding this comment

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

We should do the same as in the select context. I see that we only return the true values there. So yes this seems correct.

@ritchie46 ritchie46 merged commit 9ff5140 into pola-rs:main Sep 20, 2023
26 checks passed
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.

An error occurs when using filter in groupby.agg
2 participants