Skip to content

Commit ea64944

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

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/core/indexes/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6288,6 +6288,10 @@ def _should_compare(self, other: Index) -> bool:
62886288
# respectively.
62896289
return False
62906290

6291+
# GH#62158
6292+
if self.dtype.kind == "M" and other.inferred_type == "date":
6293+
return False
6294+
62916295
dtype = _unpack_nested_dtype(other)
62926296
return (
62936297
self._is_comparable_dtype(dtype)

0 commit comments

Comments
 (0)