87
87
ABCSeries ,
88
88
)
89
89
from pandas .core .dtypes .inference import is_list_like
90
- from pandas .core .dtypes .missing import is_valid_nat_for_dtype , isna , notna
90
+ from pandas .core .dtypes .missing import is_valid_na_for_dtype , isna , notna
91
91
92
92
if TYPE_CHECKING :
93
93
from pandas import Series
@@ -159,7 +159,7 @@ def maybe_unbox_datetimelike(value: Scalar, dtype: DtypeObj) -> Scalar:
159
159
-----
160
160
Caller is responsible for checking dtype.kind in ["m", "M"]
161
161
"""
162
- if is_valid_nat_for_dtype (value , dtype ):
162
+ if is_valid_na_for_dtype (value , dtype ):
163
163
# GH#36541: can't fill array directly with pd.NaT
164
164
# > np.empty(10, dtype="datetime64[64]").fill(pd.NaT)
165
165
# ValueError: cannot convert float NaN to integer
@@ -535,7 +535,7 @@ def maybe_promote(dtype, fill_value=np.nan):
535
535
dtype = np .dtype (np .object_ )
536
536
elif is_integer (fill_value ) or (is_float (fill_value ) and not isna (fill_value )):
537
537
dtype = np .dtype (np .object_ )
538
- elif is_valid_nat_for_dtype (fill_value , dtype ):
538
+ elif is_valid_na_for_dtype (fill_value , dtype ):
539
539
# e.g. pd.NA, which is not accepted by Timestamp constructor
540
540
fill_value = np .datetime64 ("NaT" , "ns" )
541
541
else :
@@ -551,7 +551,7 @@ def maybe_promote(dtype, fill_value=np.nan):
551
551
):
552
552
# TODO: What about str that can be a timedelta?
553
553
dtype = np .dtype (np .object_ )
554
- elif is_valid_nat_for_dtype (fill_value , dtype ):
554
+ elif is_valid_na_for_dtype (fill_value , dtype ):
555
555
# e.g pd.NA, which is not accepted by the Timedelta constructor
556
556
fill_value = np .timedelta64 ("NaT" , "ns" )
557
557
else :
0 commit comments