Skip to content

Commit d03cb23

Browse files
committed
BUG: Remove special-casing for Python date objects in DatetimeIndex
1 parent ea62b68 commit d03cb23

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

pandas/core/indexes/base.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
from collections import abc
4-
import datetime as dt
54
from datetime import datetime
65
import functools
76
from itertools import zip_longest
@@ -178,7 +177,6 @@
178177
disallow_ndim_indexing,
179178
is_valid_positional_slice,
180179
)
181-
from pandas.core.indexes.datetimes import DatetimeIndex
182180
from pandas.core.indexes.frozen import FrozenList
183181
from pandas.core.missing import clean_reindex_fill_method
184182
from pandas.core.ops import get_op_result_name
@@ -3670,14 +3668,6 @@ def get_indexer(
36703668
Notice that the return value is an array of locations in ``index``
36713669
and ``x`` is marked by -1, as it is not in ``index``.
36723670
"""
3673-
if isinstance(self, DatetimeIndex):
3674-
if hasattr(target, "__iter__") and not isinstance(target, (str, bytes)):
3675-
seq = list(target)
3676-
if seq and all(
3677-
isinstance(x, dt.date) and not isinstance(x, dt.datetime)
3678-
for x in seq
3679-
):
3680-
return np.full(len(seq), -1, dtype=np.intp)
36813671
method = clean_reindex_fill_method(method)
36823672
orig_target = target
36833673
target = self._maybe_cast_listlike_indexer(target)

0 commit comments

Comments
 (0)