Skip to content

Commit d4415b7

Browse files
is_decimal_na pandas-dev#39409
1 parent 31f48ed commit d4415b7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

pandas/_libs_numba/missing.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
# )
1818
# from pandas._libs.tslibs.np_datetime cimport get_datetime64_value, get_timedelta64_value # noqa
1919

20+
from decimal import Decimal
21+
2022
# from pandas._libs.ops_dispatch import maybe_dispatch_ufunc_to_dunder_op
2123
# from pandas.compat import IS64
2224
import numba
@@ -110,7 +112,16 @@ def checknull(val: object) -> bool:
110112
The difference between `checknull` and `checknull_old` is that `checknull`
111113
does *not* consider INF or NEGINF to be NA.
112114
"""
113-
return val is NA or is_null_datetimelike(val, inat_is_null=False)
115+
return (
116+
val is NA or is_null_datetimelike(val, inat_is_null=False) or is_decimal_na(val)
117+
)
118+
119+
120+
def is_decimal_na(val: object) -> bool:
121+
"""
122+
Is this a decimal.Decimal object Decimal("NAN").
123+
"""
124+
return isinstance(val, Decimal) and val != val
114125

115126

116127
# cpdef bint checknull_old(object val):

0 commit comments

Comments
 (0)