Skip to content

Commit 957d33a

Browse files
committed
BUG: Remove special-casing for Python date objects in DatetimeIndex
1 parent 3b38f8d commit 957d33a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pandas/core/indexes/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6289,6 +6289,8 @@ def _should_compare(self, other: Index) -> bool:
62896289
# found. Without this fix False and True would be treated as 0 and 1
62906290
# respectively.
62916291
return False
6292+
if self.dtype.kind == "M" and other.inferred_type == "date":
6293+
return False
62926294

62936295
dtype = _unpack_nested_dtype(other)
62946296
return (

0 commit comments

Comments
 (0)