-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
API: membership checks on ExtensionArray containing NA values #37867
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
Changes from all commits
7ab6443
7986bc4
466f7cc
a9b75dd
9d0eca1
b0b32ab
c6e42d2
75c45bc
83c9fe4
08c4c98
5a23b1d
4b0c200
92604e9
8a24f0d
fdb9deb
52e2b43
f21890e
6f633c7
d8bdb2e
4e4dbc4
a1583e7
3c2c2b0
237fe45
37219c3
c4a6c36
245c99a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,28 @@ def test_memory_usage(self, data): | |
# Is this deliberate? | ||
super().test_memory_usage(data) | ||
|
||
def test_contains(self, data, data_missing, nulls_fixture): | ||
# GH-37867 | ||
# na value handling in Categorical.__contains__ is deprecated. | ||
# See base.BaseInterFaceTests.test_contains for more details. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This duplicates what you have in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately not: na values is also more complicated in categoricals, because in some cases we want to accept There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be clear, I was not referring to the base tests that this is overriding, but the original test you added to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah. I'll delete the ones in |
||
|
||
na_value = data.dtype.na_value | ||
# ensure data without missing values | ||
data = data[~data.isna()] | ||
|
||
# first elements are non-missing | ||
assert data[0] in data | ||
assert data_missing[0] in data_missing | ||
|
||
# check the presence of na_value | ||
assert na_value in data_missing | ||
assert na_value not in data | ||
|
||
# Categoricals can contain other nan-likes than na_value | ||
if nulls_fixture is not na_value: | ||
assert nulls_fixture not in data | ||
assert nulls_fixture in data_missing # this line differs from super method | ||
|
||
|
||
class TestConstructors(base.BaseConstructorsTests): | ||
pass | ||
|
Uh oh!
There was an error while loading. Please reload this page.