File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 17
17
# )
18
18
# from pandas._libs.tslibs.np_datetime cimport get_datetime64_value, get_timedelta64_value # noqa
19
19
20
+ from decimal import Decimal
21
+
20
22
# from pandas._libs.ops_dispatch import maybe_dispatch_ufunc_to_dunder_op
21
23
# from pandas.compat import IS64
22
24
import numba
@@ -110,7 +112,16 @@ def checknull(val: object) -> bool:
110
112
The difference between `checknull` and `checknull_old` is that `checknull`
111
113
does *not* consider INF or NEGINF to be NA.
112
114
"""
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
114
125
115
126
116
127
# cpdef bint checknull_old(object val):
You can’t perform that action at this time.
0 commit comments