-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: No need to delegate to index check of whether an int is an int #21982
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ def test_scalar_error(self): | |
def f(): | ||
s.iloc[3.0] | ||
tm.assert_raises_regex(TypeError, | ||
'cannot do positional indexing', | ||
'Cannot index by location index', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. side issue, we have 2 different versions of this error message (the original also happens), so these should be the same (future PR). I don't think we actually need to distinguish them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We already have both messages in the code (I did not write a new message). The only difference is that now this case raises the correct one. |
||
f) | ||
|
||
def f(): | ||
|
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 check if there is any remaining occasion where
_convert_scalar_indexer
is used foriloc
(in principle it shouldn't?). Because if not,_convert_scalar_indexer
has some redundant codeThere 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.
Yes, there is, and it was related to a commit I pushed but then removed, because unfortunately it broke some tests and I don't have time to check them in the next days. So I went for the obvious change only, will add the rest in some other PR (which I think will be quite large, as I will also touch code in indexes).
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.
OK. Can you point to where it is currently used? (to have this on record)
Is it worth to add a todo comment there?
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'll rebase my other PR on this once merged, push it and open an issue referring to it