-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Check types in Index.__contains__ (#22085) #22360
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 10 commits
4ae2e60
b8f164e
004c855
c1409cb
f979733
a88497a
511060a
a5f2388
d61db2c
2aa3920
8384a3c
4eec1b4
6093091
20a6bd6
6e9f5a5
0b8217e
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 |
---|---|---|
|
@@ -1993,7 +1993,11 @@ def __nonzero__(self): | |
def __contains__(self, key): | ||
hash(key) | ||
try: | ||
return key in self._engine | ||
if (is_float(key) and is_integer_dtype(self.dtype) and | ||
int(key) != key): | ||
return False | ||
else: | ||
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. don't need the else here. 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. Done. |
||
return key in self._engine | ||
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. this is ok in python code, but actually can you see if you can do this in the cython code? 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. Thanks. But I'm not good at Cython now. I'd like to try it but it'll take time. |
||
except (OverflowError, TypeError, ValueError): | ||
return False | ||
|
||
|
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.
use double-backticks on the
Index
(2nd use in sentence)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.