Skip to content

Commit

Permalink
Exclude datelike types
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke committed Jul 18, 2024
1 parent acd7cde commit b21fdae
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions python/cudf/cudf/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,10 @@ def _data(self):
@_performance_tracking
def __contains__(self, item):
hash(item)
if isinstance(item, bool) or not isinstance(
item, (np.floating, np.integer, int, float)
):
if not isinstance(item, (np.floating, np.integer, int, float)):
return False
elif isinstance(item, (np.timedelta64, np.datetime64)):
# Are instances of np.integer
elif isinstance(item, (np.timedelta64, np.datetime64, bool)):
# Cases that would pass the above check
return False
try:
int_item = int(item)
Expand Down

0 comments on commit b21fdae

Please sign in to comment.