@@ -51,8 +51,7 @@ from pandas._libs.tslibs.conversion cimport (
51
51
get_datetime64_nanos)
52
52
53
53
from pandas._libs.tslibs.nattype import nat_strings
54
- from pandas._libs.tslibs.nattype cimport (
55
- checknull_with_nat, NPY_NAT, c_NaT as NaT)
54
+ from pandas._libs.tslibs.nattype cimport NPY_NAT, c_NaT as NaT
56
55
57
56
from pandas._libs.tslibs.offsets cimport to_offset
58
57
@@ -64,6 +63,9 @@ from pandas._libs.tslibs.tzconversion cimport (
64
63
tz_convert_utc_to_tzlocal,
65
64
)
66
65
66
+ # Note: this is the only non-tslibs intra-pandas dependency here
67
+ from pandas._libs.missing cimport checknull_with_nat_and_na
68
+
67
69
68
70
cdef inline object create_datetime_from_ts(
69
71
int64_t value,
@@ -438,7 +440,7 @@ def array_with_unit_to_datetime(
438
440
for i in range (n):
439
441
val = values[i]
440
442
441
- if checknull_with_nat (val):
443
+ if checknull_with_nat_and_na (val):
442
444
iresult[i] = NPY_NAT
443
445
444
446
elif is_integer_object(val) or is_float_object(val):
@@ -505,7 +507,7 @@ def array_with_unit_to_datetime(
505
507
for i in range (n):
506
508
val = values[i]
507
509
508
- if checknull_with_nat (val):
510
+ if checknull_with_nat_and_na (val):
509
511
oresult[i] = < object > NaT
510
512
elif is_integer_object(val) or is_float_object(val):
511
513
@@ -602,7 +604,7 @@ cpdef array_to_datetime(
602
604
val = values[i]
603
605
604
606
try :
605
- if checknull_with_nat (val):
607
+ if checknull_with_nat_and_na (val):
606
608
iresult[i] = NPY_NAT
607
609
608
610
elif PyDateTime_Check(val):
@@ -812,7 +814,7 @@ cdef ignore_errors_out_of_bounds_fallback(ndarray[object] values):
812
814
val = values[i]
813
815
814
816
# set as nan except if its a NaT
815
- if checknull_with_nat (val):
817
+ if checknull_with_nat_and_na (val):
816
818
if isinstance (val, float ):
817
819
oresult[i] = np.nan
818
820
else :
@@ -874,7 +876,7 @@ cdef array_to_datetime_object(
874
876
# 2) datetime strings, which we return as datetime.datetime
875
877
for i in range (n):
876
878
val = values[i]
877
- if checknull_with_nat (val) or PyDateTime_Check(val):
879
+ if checknull_with_nat_and_na (val) or PyDateTime_Check(val):
878
880
# GH 25978. No need to parse NaT-like or datetime-like vals
879
881
oresult[i] = val
880
882
elif isinstance (val, str ):
0 commit comments