Skip to content

Commit d8379c3

Browse files
committed
BUG: Remove special-casing for Python date objects in DatetimeIndex
1 parent 8fe9ccd commit d8379c3

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

pandas/core/indexes/base.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6290,10 +6290,6 @@ def _should_compare(self, other: Index) -> bool:
62906290
# respectively.
62916291
return False
62926292

6293-
# GH#62158
6294-
if self.dtype.kind == "M" and other.inferred_type == "date":
6295-
return False
6296-
62976293
dtype = _unpack_nested_dtype(other)
62986294
return (
62996295
self._is_comparable_dtype(dtype)
@@ -6317,10 +6313,8 @@ def _is_comparable_dtype(self, dtype: DtypeObj) -> bool:
63176313
if dtype.kind != "M":
63186314
if self.dtype.kind == "m" and pa.types.is_duration(pa_dtype):
63196315
return True
6320-
if self.dtype.kind == "O":
6321-
return True
63226316
return False
6323-
if self.dtype.kind != "M" and self.dtype.kind != "O":
6317+
if self.dtype.kind != "M":
63246318
return False
63256319
if pa.types.is_date(pa_dtype):
63266320
return False

0 commit comments

Comments
 (0)