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

polars.Expr.all method description is unclear on ignore_nulls parameter logic #17373

Closed
fci525 opened this issue Jul 2, 2024 · 0 comments · Fixed by #20409
Closed

polars.Expr.all method description is unclear on ignore_nulls parameter logic #17373

fci525 opened this issue Jul 2, 2024 · 0 comments · Fixed by #20409
Labels
documentation Improvements or additions to documentation

Comments

@fci525
Copy link

fci525 commented Jul 2, 2024

Description

Documentation says:

If set to False, Kleene logic is used to deal with nulls: if the column contains any null values and no True values, the output is null.

This is immediately suspect in the example provided, where column c, containing None and True values, returns null. Also, a column containing only null values could be said to "contain no True values", but would produce an error since the method expects the series type to be Boolean and not null.

The stated logic is also not consistent with the documentation's linked article on Kleene logic. However, in testing, the actual method's behavior is consistent. Perhaps it would be more correct to say:

If set to False, Kleene logic is used to deal with nulls: if the column contains only True values, the output is true, while if it contains any False values, the output is false. If it contains only null and True values, the output is null.

Link

https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.all.html#polars.Expr.all

@fci525 fci525 added the documentation Improvements or additions to documentation label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant