Skip to content

Commit 48595e1

Browse files
committed
BUG: Remove special-casing for Python date objects in DatetimeIndex
1 parent 8ff37c6 commit 48595e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/indexes/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6304,11 +6304,11 @@ def _is_comparable_dtype(self, dtype: DtypeObj) -> bool:
63046304
elif is_numeric_dtype(self.dtype):
63056305
return is_numeric_dtype(dtype)
63066306
# GH#62158
6307+
elif self.dtype.kind == "M" and dtype == object:
6308+
return False
63076309
elif isinstance(dtype, ArrowDtype):
63086310
import pyarrow as pa
63096311

6310-
if self.dtype.kind != "M" or dtype.kind != "M":
6311-
return False
63126312
pa_dtype = dtype.pyarrow_dtype
63136313
if pa.types.is_date(pa_dtype):
63146314
return False

0 commit comments

Comments
 (0)