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

Add pl.col(...).is_not_in(<iterable>) method #16419

Closed
DeflateAwning opened this issue May 22, 2024 · 4 comments
Closed

Add pl.col(...).is_not_in(<iterable>) method #16419

DeflateAwning opened this issue May 22, 2024 · 4 comments
Labels
enhancement New feature or an improvement of an existing feature

Comments

@DeflateAwning
Copy link
Contributor

DeflateAwning commented May 22, 2024

Description

Feature Request: Add pl.col(...).is_not_in(<iterable>) method.

Using the bitwise inverter/negator (~) with .is_in([...]) is a bit easier to miss, easier to screw up order-of-operations, etc. In the same way that there's a .is_null() and .is_not_null(), I think it would be awesome if there were both is_in() and is_not_in().

Not that this bears much weight, but GitHub Copilot expects it to exist, which suggests it's common in similar/competitor libraries.

@DeflateAwning DeflateAwning added the enhancement New feature or an improvement of an existing feature label May 22, 2024
@owenprough-sift
Copy link

owenprough-sift commented May 22, 2024

Duplicate of "wontfix" #6574, but I would also appreciate having an is_not_in() expression. It would be convenient/ergonomic. But if the rationale from the other issue holds, should I submit an issue to remove is_not_null()?

@DeflateAwning
Copy link
Contributor Author

Darn, well I guess I'll ask again and see if they'll reconsider

@stinodego
Copy link
Member

stinodego commented May 23, 2024

We will not add this, for the reasons mentioned in the linked issue.

If you don't like negating with ~ you can also use not_, e.g. pl.col(...).is_in(...).not_().

is_not_null is there because it is a (free) represention of the underlying validity buffer. We may remove it when we have sufficiently improve our IR.

@stinodego stinodego closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2024
@DeflateAwning
Copy link
Contributor Author

Darn, well thanks for the response anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants