-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
REF: remove _convert_scalar_indexer #31962
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
REF: remove _convert_scalar_indexer #31962
Conversation
@jbrockmendel can you merge master |
xref #25996 |
Definitely simplifies things so +1 there. Does this need to get bundled with the other PR to comprehensively raise a |
Yes. |
closing to clear the queue, will re-open following #31867. |
re-opened following #31867 |
pandas/core/series.py
Outdated
if key_is_scalar: | ||
key = self.index._convert_scalar_indexer(key, kind="getitem") | ||
elif isinstance(key, (list, tuple)): | ||
if not key_is_scalar and isinstance(key, (list, tuple)): |
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.
do we need the not key_is_scalar
and is there some overlap with the check in L872-875
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.
will remove the redundant part of the check; will hold off on more invasive refactor
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.
probably no need then if refactoring later. I guess this is more performant at the expense of clarity. This method looks like it just needs one if key_is_scalar and an else.
love it. if you can rebase (not sure if it was before). merge on green. |
Thanks @jbrockmendel |
This sits on top of #31867, so is partially a demonstration of how much complication is caused by our inconsistent error-raising.