Skip to content

REF: implement unpack_1tuple to clean up Series.__getitem__ #31906

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 2 commits into from
Feb 17, 2020

Conversation

jbrockmendel
Copy link
Member

Doing this up-front instead of in two places makes for a nice cleanup. There will be a small perf penalty for the cases that wouldn't otherwise need to do these checks.

@jreback jreback added the Indexing Related to indexing on series/frames, not to indexes themselves label Feb 17, 2020
@jreback jreback added this to the 1.1 milestone Feb 17, 2020
@jreback jreback added the Refactor Internal refactoring of code label Feb 17, 2020
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

lgtm. typing suggestion as followup.

@@ -270,6 +270,33 @@ def deprecate_ndim_indexing(result):
)


def unpack_1tuple(tup):
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

type when you can Union[List, Tuple] ?

@jreback jreback merged commit 92bb4c9 into pandas-dev:master Feb 17, 2020
@jbrockmendel jbrockmendel deleted the unpack_tuple branch February 17, 2020 22:16
roberthdevries pushed a commit to roberthdevries/pandas that referenced this pull request Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Indexing Related to indexing on series/frames, not to indexes themselves Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants