-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
is_in
and ==
treat nulls differently
#9247
Comments
I would add this to a growing list of things to fix with I don't know if its' worth my 2c here, but I don't think s.is_in([None, "a"]) # true Going by this understanding, |
I disagree; this would return a single boolean for the entire series, i.e. it means To ask if any element |
This is much clearer an interpretation, thank you. I don't quite know how to convey my interpretation of why I don't think |
Well, |
I was leaning towards set theory in my mental explanation, but I learnt that so long ago I couldn't really articulate well. Thanks for the patient listening, @mcrumiller! |
So we changed equality to mimic other engines. That means that I think for the # this should error. We should only allow `Series` or `list<T>`.
s.is_in(None) This returns s = pl.Series([None], dtype=pl.Utf8)
s.is_in([None]) |
Polars version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
Issue description
is_in([x])
should be equivalent to== x
for single items, but the treatment of nulls is different. I'm not sure if this is intended.Similarly,
.is_in([None])
evaluations to True, whereas==None
raises an exception.Reproducible example
Expected behavior
Both false or both null.
Installed versions
The text was updated successfully, but these errors were encountered: