Skip to content

Commit e4deebc

Browse files
committed
Restore is_complex_array signature and logic to match main
1 parent 65fde97 commit e4deebc

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

pandas/_libs/lib.pyx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ def is_scalar(val: object) -> bool:
176176
- Fraction
177177
- Number.
178178

179+
179180
Returns
180181
-------
181182
bool
@@ -209,6 +210,13 @@ def is_scalar(val: object) -> bool:
209210
>>> from fractions import Fraction
210211
>>> pd.api.types.is_scalar(Fraction(3, 5))
211212
True
213+
214+
>>> from enum import Enum, auto
215+
>>> class Thing(Enum):
216+
... one = auto()
217+
... two = auto()
218+
>>> pd.api.types.is_scalar(Thing.one)
219+
False
212220
"""
213221
214222
# Start with C-optimized checks
@@ -1974,9 +1982,11 @@ cdef class ComplexValidator(Validator):
19741982
return cnp.PyDataType_ISCOMPLEX(self.dtype)
19751983
19761984
1977-
cdef bint is_complex_array(ndarray values):
1985+
cdef bint is_complex_array(ndarray values, bint skipna=True):
19781986
cdef:
1979-
ComplexValidator validator = ComplexValidator(values.size, values.dtype)
1987+
ComplexValidator validator = ComplexValidator(values.size,
1988+
values.dtype,
1989+
skipna=skipna)
19801990
return validator.validate(values)
19811991
19821992

0 commit comments

Comments
 (0)