Skip to content

CLN: Remove redundant index test from tests/base/test_ops.py #32484

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

Conversation

SaturnFromTitan
Copy link
Contributor

@SaturnFromTitan SaturnFromTitan commented Mar 6, 2020

part of #23877

  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff

Boolean indexing is already thoroughly tested in test_series_mask_boolean in tests/indexes/test_na_indexing.py - see here

@SaturnFromTitan SaturnFromTitan force-pushed the remove-redundant-index-test-from-tests-base branch from 5af92b6 to 3d93ec0 Compare March 6, 2020 10:23
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On board with cleaning up, but are we not losing any coverage here? Maybe overlooking, but one that sticks out is indexing with an Index object which appears here but I think not in the test you linked to replace this?

@WillAyd WillAyd added Testing pandas testing functions or related to the test suite Clean labels Mar 6, 2020
@SaturnFromTitan
Copy link
Contributor Author

Good point @WillAyd, I'll check that later. I was assuming that if we lose coverage, then I'd get a codecov warning here in the PR. Isn't there a bot for these sort of things?

@WillAyd
Copy link
Member

WillAyd commented Mar 7, 2020 via email

msg = "iLocation based boolean indexing cannot use an indexable as a mask"
expectation = pytest.raises(ValueError, match=msg)
else:
expectation = do_not_raise()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SaturnFromTitan
Copy link
Contributor Author

@WillAyd I think this is ready for another review now. I added an indexer_class parametrization to test_series_mask_boolean and refactored the test a little bit (which I mostly had to do to get it passing)

@@ -7,6 +7,7 @@
@pytest.mark.parametrize(
"values, dtype",
[
([], "object"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty scenario was previously covered with some redundant code in the bottom of the test. I moved it to the parametrization instead and adjusted the generic test code to handle it properly

@jreback jreback added this to the 1.1 milestone Mar 11, 2020
@jreback
Copy link
Contributor

jreback commented Mar 11, 2020

looks ok, will have to look again after @WillAyd comments are addressed.

@SaturnFromTitan
Copy link
Contributor Author

@jreback I addressed all comments of @WillAyd (added the lost test cases to the parametrization of test_series_mask_boolean)

@jreback jreback merged commit ff7e2fa into pandas-dev:master Mar 14, 2020
@jreback
Copy link
Contributor

jreback commented Mar 14, 2020

thanks @SaturnFromTitan

SeeminSyed pushed a commit to CSCD01-team01/pandas that referenced this pull request Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants