Skip to content

Commit 7e5789f

Browse files
committed
precommit and moved imports to top of files
1 parent 0f43eca commit 7e5789f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

pandas/core/indexes/datetimelike.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
from pandas.core.dtypes.common import (
4444
is_integer,
4545
is_list_like,
46+
is_timedelta64_dtype,
4647
)
4748
from pandas.core.dtypes.concat import concat_compat
4849
from pandas.core.dtypes.dtypes import (
@@ -57,6 +58,7 @@
5758
TimedeltaArray,
5859
)
5960
from pandas.core.arrays.datetimelike import DatetimeLikeArrayMixin
61+
from pandas.core.arrays.timedeltas import sequence_to_td64ns
6062
import pandas.core.common as com
6163
import pandas.core.indexes.base as ibase
6264
from pandas.core.indexes.base import (
@@ -419,13 +421,11 @@ def _maybe_cast_listlike_indexer(self, keyarr):
419421
res_index = Index(res, dtype=res.dtype)
420422

421423
if isinstance(res, ExtensionArray):
422-
from pandas.core.dtypes.common import is_timedelta64_dtype
423-
from pandas.core.arrays.timedeltas import sequence_to_td64ns
424-
425-
if res_index.dtype == "string[pyarrow]" and is_timedelta64_dtype(self.dtype):
424+
if res_index.dtype == "string[pyarrow]" and is_timedelta64_dtype(
425+
self.dtype
426+
):
426427
data, freq = sequence_to_td64ns(res_index, copy=False, unit=None)
427428
res_index = type(res_index)(data)
428-
429429
return res_index
430430

431431

pandas/core/indexes/datetimes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ def _is_comparable_dtype(self, dtype: DtypeObj) -> bool:
384384
if self.tz is not None:
385385
# If we have tz, we can compare to tzaware
386386
return isinstance(dtype, DatetimeTZDtype)
387-
388387
# if we dont have tz, we can only compare to tznaive
389388
return lib.is_np_dtype(dtype, "M")
390389

0 commit comments

Comments
 (0)