Skip to content

REF: separate bloated test #28081

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

Merged
merged 1 commit into from
Sep 2, 2019

Conversation

jbrockmendel
Copy link
Member

Working on logical ops I'm finding a bunch of internal inconsistencies that will need to be addressed. Since those are liable to have large diffs, this starts off with refactor that leaves behavior unchanged: simplify the method itself, and split a giant test into well-scoped ones.

with pytest.raises(TypeError):
s_0123 & np.NaN
with pytest.raises(TypeError):
s_0123 & 3.14
with pytest.raises(TypeError):
s_0123 & [0.1, 4, 3.14, 2]
with pytest.raises(TypeError):
s_0123 & np.array([0.1, 4, 3.14, 2])
Copy link
Member Author

Choose a reason for hiding this comment

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

this assertion is the only new one, everything else is just moved around

@gfyoung gfyoung added Refactor Internal refactoring of code Testing pandas testing functions or related to the test suite labels Aug 26, 2019
Copy link
Member

@gfyoung gfyoung left a comment

Choose a reason for hiding this comment

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

I think this refactoring makes sense.

Perhaps we could clear out some of the TODO's you added in this PR in the PR itself though.

@jbrockmendel
Copy link
Member Author

Perhaps we could clear out some of the TODO's you added in this PR in the PR itself though.

Separate PR(s). Lots of small steps.

@@ -791,28 +791,33 @@ def wrapper(self, other):
self, other = _align_method_SERIES(self, other, align_asobject=True)
res_name = get_op_result_name(self, other)

# TODO: shouldn't we be applying finalize whenever
# not isinstance(other, ABCSeries)?
finalizer = (
Copy link
Member

Choose a reason for hiding this comment

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

What are the code changes here required for? Separate from the actual test split?

Copy link
Member Author

Choose a reason for hiding this comment

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

The goal is to isolate Series-specific parts of the function from EA/ndarray parts (see also _arith_method_SERIES and _comp_method_SERIES in #28066).

Copy link
Member

Choose a reason for hiding this comment

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

Is there a way to move the tests without making code changes? I'm admittedly not very well versed with this code so I might be missing something simple, but I think test and code changes as separate PRs is a safer approach

Copy link
Member Author

Choose a reason for hiding this comment

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

That's basically the idea of this PR. This is technically a code change, but it is about as benign as they come

@jreback jreback added this to the 1.0 milestone Sep 2, 2019
@jreback jreback merged commit 2aeed3f into pandas-dev:master Sep 2, 2019
@jreback
Copy link
Contributor

jreback commented Sep 2, 2019

thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the bool_ops_unchanged branch September 2, 2019 22:56
MarcoGorelli pushed a commit to MarcoGorelli/pandas that referenced this pull request Sep 3, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Internal refactoring of code Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants