-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: Split and simplify test_value_counts_unique_nunique #32281
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
TST: Split and simplify test_value_counts_unique_nunique #32281
Conversation
5a39679
to
b3f6091
Compare
The failing CI is unrelated to these changes |
b3f6091
to
e9e4489
Compare
…nique_null-in-pandas-tests-base-test_ops-py
@jreback merged master to resolve conflicts |
result = obj.value_counts() | ||
tm.assert_series_equal(result, expected_s) | ||
assert result.index.name is None | ||
@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.
can you use nulls_fixture
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.
I tried using nulls_fixture
and unique_nulls_fixture
. Nearly all configurations break for pd.NaT
and pd.NA
though...
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.
ok, yeah we need to test these, can you create an issue. we will want to add these even if they need xfailing for now as there is no testing on them.
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.
xref: #32437
klass = type(obj) | ||
values = obj._ndarray_values | ||
num_values = len(orig) | ||
def test_nunique_null(self, null_obj, index_or_series_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.
same
…nique_null-in-pandas-tests-base-test_ops-py
result = obj.value_counts() | ||
tm.assert_series_equal(result, expected_s) | ||
assert result.index.name is None | ||
@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.
ok, yeah we need to test these, can you create an issue. we will want to add these even if they need xfailing for now as there is no testing on them.
thanks @SaturnFromTitan one other followup on this. I think we should split out the tests you just changed (e.g. unique, value_counts) into a test_unique.py module; happy to do this generally as well (though should be separate from a refactorting PR). |
Will do. I'll wait until #32311 is merged though as I think it should go into the test_uniques.py as well |
closes #32205, closes #32220
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff