Skip to content

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

Merged
merged 4 commits into from
Sep 26, 2019

Conversation

jbrockmendel
Copy link
Member

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

         if not len(other):
            return self * np.nan 

is actually wrong in the non-float test case in L681-685 in the test file.

return self._constructor(
data=self._series, index=self.index, columns=self.columns
)

# default axis is columns
Copy link
Contributor

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

Copy link
Member Author

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

Copy link
Member Author

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
Copy link
Contributor

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.

@jreback jreback added the Testing pandas testing functions or related to the test suite label Sep 25, 2019
@jreback jreback added this to the 1.0 milestone Sep 25, 2019
@jreback jreback added the Compat pandas objects compatability with Numpy or Python functions label Sep 25, 2019
@jbrockmendel
Copy link
Member Author

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.

@jreback jreback merged commit e7cb6b3 into pandas-dev:master Sep 26, 2019
@jreback
Copy link
Contributor

jreback commented Sep 26, 2019

great thanks

@jbrockmendel jbrockmendel deleted the combine_corner branch September 26, 2019 14:47
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
bongolegend pushed a commit to bongolegend/pandas that referenced this pull request Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants