Skip to content

Commit bda37e8

Browse files
committed
Updated _infer_matches and _maybe_downcast_for_indexing
1 parent 7bfef3b commit bda37e8

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

pandas/core/arrays/datetimes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ class DatetimeArray(dtl.TimelikeOps, dtl.DatelikeOps): # type: ignore[misc]
228228
_is_recognized_dtype = lambda x: lib.is_np_dtype(x, "M") or isinstance(
229229
x, DatetimeTZDtype
230230
)
231-
_infer_matches = ("datetime", "datetime64", "date")
231+
_infer_matches = ("datetime", "datetime64")
232232

233233
@property
234234
def _scalar_type(self) -> type[Timestamp]:

pandas/core/indexes/base.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6205,11 +6205,6 @@ def _maybe_downcast_for_indexing(self, other: Index) -> tuple[Index, Index]:
62056205
# standardize on UTC
62066206
return self.tz_convert("UTC"), other.tz_convert("UTC")
62076207

6208-
elif self.inferred_type == "date" and isinstance(other, ABCDatetimeIndex):
6209-
try:
6210-
return type(other)(self), other
6211-
except OutOfBoundsDatetime:
6212-
return self, other
62136208
elif self.inferred_type == "timedelta" and isinstance(other, ABCTimedeltaIndex):
62146209
# TODO: we dont have tests that get here
62156210
return type(other)(self), other
@@ -6232,7 +6227,6 @@ def _maybe_downcast_for_indexing(self, other: Index) -> tuple[Index, Index]:
62326227
if not is_object_dtype(self.dtype) and is_object_dtype(other.dtype):
62336228
# Reverse op so we dont need to re-implement on the subclasses
62346229
other, self = other._maybe_downcast_for_indexing(self)
6235-
62366230
return self, other
62376231

62386232
@final

0 commit comments

Comments
 (0)