We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d284baa commit 81ffd4aCopy full SHA for 81ffd4a
pandas/core/dtypes/cast.py
@@ -75,11 +75,10 @@
75
from pandas.core.dtypes.inference import is_list_like
76
from pandas.core.dtypes.missing import is_valid_nat_for_dtype, isna, notna
77
78
-from pandas.core.indexes.datetimes import DatetimeIndex
79
-
80
if TYPE_CHECKING:
81
from pandas import Series
82
from pandas.core.arrays import ExtensionArray
+ from pandas.core.indexes.datetimes import DatetimeIndex
83
84
_int8_max = np.iinfo(np.int8).max
85
_int16_max = np.iinfo(np.int16).max
@@ -1020,7 +1019,7 @@ def astype_nansafe(
1020
1019
1021
def maybe_convert_objects(
1022
values: np.ndarray, convert_numeric: bool = True
1023
-) -> Union[np.ndarray, DatetimeIndex]:
+) -> Union[np.ndarray, "DatetimeIndex"]:
1024
"""
1025
If we have an object dtype array, try to coerce dates and/or numbers.
1026
0 commit comments