-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF/TST: Corner cases for op(DataFrame, Series) #28600
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
pandas/core/ops/__init__.py
Outdated
return self._constructor( | ||
data=self._series, index=self.index, columns=self.columns | ||
) | ||
|
||
# default axis is columns |
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 would now remove the else as this is the default case
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.
sure. follow-up is going to re-write this func anyway
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.
done+green
|
||
|
||
def test_frame_with_zero_len_series_corner_cases(): | ||
# easy all-float case |
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 reference this issue in these.
gentle ping. The follow-ups to this are both a) really nice code-removals and b) orthogonal to the rest of the current ops stuff. |
great thanks |
We have two special cases in
_combine_series_frame
that are never tested ATM. This adds tests for them, then notes that the special case handling code is unnecessary and this can now fall through to the general case code. In a follow-up, we'll be able to simplify _combine_series_frame further, but for now I want to keep the changed logic obvious.Also note that the removed
is actually wrong in the non-float test case in L681-685 in the test file.