Skip to content

Commit 14a737d

Browse files
Daniel SaxtonDaniel Saxton
Daniel Saxton
authored and
Daniel Saxton
committed
Use checknull
1 parent 2d45b21 commit 14a737d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pandas/_libs/hashtable_class_helper.pxi.in

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ WARNING: DO NOT edit .pxi FILE directly, .pxi is generated from .pxi.in
1010
# ----------------------------------------------------------------------
1111

1212
from pandas._libs.tslibs.util cimport get_c_string
13-
from pandas._libs.missing cimport C_NA
13+
from pandas._libs.missing cimport checknull
1414

1515
{{py:
1616

@@ -1034,9 +1034,7 @@ cdef class PyObjectHashTable(HashTable):
10341034
hash(val)
10351035

10361036
if ignore_na and (
1037-
(val is C_NA)
1038-
or (val != val)
1039-
or (val is None)
1037+
checknull(val)
10401038
or (use_na_value and val == na_value)
10411039
):
10421040
# if missing values do not count as unique values (i.e. if

pandas/_libs/missing.pyx

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ cpdef bint checknull(object val):
3333
Return boolean describing of the input is NA-like, defined here as any
3434
of:
3535
- None
36+
- pd.NA
3637
- nan
3738
- NaT
3839
- np.datetime64 representation of NaT

0 commit comments

Comments
 (0)