Skip to content

Commit 35c36a9

Browse files
dsaxtonrhshadrach
authored andcommitted
CLN: Remove is_null_period (pandas-dev#33750)
1 parent c45636e commit 35c36a9

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

pandas/_libs/lib.pyx

+6-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ cimport pandas._libs.util as util
6767
from pandas._libs.util cimport is_nan, UINT64_MAX, INT64_MAX, INT64_MIN
6868

6969
from pandas._libs.tslib import array_to_datetime
70-
from pandas._libs.tslibs.nattype cimport NPY_NAT, c_NaT as NaT
70+
from pandas._libs.tslibs.nattype cimport (
71+
NPY_NAT,
72+
c_NaT as NaT,
73+
checknull_with_nat,
74+
)
7175
from pandas._libs.tslibs.conversion cimport convert_to_tsobject
7276
from pandas._libs.tslibs.timedeltas cimport convert_to_timedelta64
7377
from pandas._libs.tslibs.timezones cimport get_timezone, tz_compare
@@ -77,7 +81,6 @@ from pandas._libs.missing cimport (
7781
isnaobj,
7882
is_null_datetime64,
7983
is_null_timedelta64,
80-
is_null_period,
8184
C_NA,
8285
)
8386

@@ -1844,7 +1847,7 @@ cdef class PeriodValidator(TemporalValidator):
18441847
return util.is_period_object(value)
18451848

18461849
cdef inline bint is_valid_null(self, object value) except -1:
1847-
return is_null_period(value)
1850+
return checknull_with_nat(value)
18481851

18491852

18501853
cpdef bint is_period_array(ndarray values):

pandas/_libs/missing.pxd

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ cpdef ndarray[uint8_t] isnaobj(ndarray arr)
66

77
cdef bint is_null_datetime64(v)
88
cdef bint is_null_timedelta64(v)
9-
cdef bint is_null_period(v)
109

1110
cdef class C_NAType:
1211
pass

pandas/_libs/missing.pyx

+1-6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ cpdef bint checknull(object val):
4040
- NaT
4141
- np.datetime64 representation of NaT
4242
- np.timedelta64 representation of NaT
43+
- NA
4344
4445
Parameters
4546
----------
@@ -278,12 +279,6 @@ cdef inline bint is_null_timedelta64(v):
278279
return False
279280

280281

281-
cdef inline bint is_null_period(v):
282-
# determine if we have a null for a Period (or integer versions),
283-
# excluding np.datetime64('nat') and np.timedelta64('nat')
284-
return checknull_with_nat(v)
285-
286-
287282
# -----------------------------------------------------------------------------
288283
# Implementation of NA singleton
289284

0 commit comments

Comments
 (0)