-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: Split and fixturized test_fillna in tests/base/test_ops.py #32483
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
CLN: Split and fixturized test_fillna in tests/base/test_ops.py #32483
Conversation
|
||
if needs_i8_conversion(o): | ||
@pytest.mark.parametrize("null_obj", [np.nan, None]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using nulls_fixture
should be taken care of in #32437
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few nits related to #27353
@MomIsBestFriend Seems like that didn't work for the
I'll revert it to a simple |
if len(obj) == 0: | ||
pytest.skip("Test doesn't make sense on empty data") | ||
elif isinstance(obj, ABCMultiIndex): | ||
pytest.skip("MultiIndex doesn't support isna") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this an open issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment below, this is related to MultiIndex
not being able to hold "pure" NA values
elif len(obj) < 1: | ||
pytest.skip("Test doesn't make sense on empty data") | ||
elif isinstance(obj, ABCMultiIndex): | ||
pytest.skip(f"MultiIndex can't hold '{null_obj}'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another open issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this by design? A MultiIndex must hold values on multiple levels, so its elements are tuples. Therefore a MultiIndex
can't just hold a raw np.nan
or None
as a value. Maybe a tuple of nans might make sense, but I don't think that would be recognised as "na" by fillna.
thanks @SaturnFromTitan ideally if you can add the nulls fixture would be great :-> |
part of #23877
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff