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(rust, python): raise error on ambiguous filter predicates #7265

Merged
merged 1 commit into from
Mar 1, 2023

Conversation

ritchie46
Copy link
Member

People tend to trip over expression expansion. Make it clear in the error message that the expressions are expanded.

df = pl.DataFrame({"a": [None, "2", "3"], "b": [None, None, "z"]})
df.filter(pl.col(['a','b']).is_null())
ComputeError: The predicate passed to 'filter' expanded to multiple expressions: 

	col("a").is_null(),
	col("b").is_null(),

This is ambiguous. Try to combine the predicates with the 'all' or `any' expression.

> Error originated just after operation: '  DF ["a", "b"]; PROJECT */2 COLUMNS; SELECTION: "None"
'
This operation could not be added to the plan.

closes #6808
closes #7254

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Mar 1, 2023
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.

Inconsistent behavior for is_duplicated on multiple columns. Filter based on nulls in multiple columns
1 participant