Skip to content

Commit 09e35b6

Browse files
Copilotjoocer
andcommitted
Use numpy.issubdtype for more robust integer type detection
Co-authored-by: joocer <1688479+joocer@users.noreply.github.com>
1 parent 41bf6b1 commit 09e35b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

opteryx/managers/expression/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def _inner_evaluate(root: Node, table: Table):
272272
if not isinstance(centre, pyarrow.Array):
273273
centre = numpy.asarray(centre)
274274
# Convert numeric types (e.g., uint8 from list_contains_any) to boolean
275-
if centre.dtype in (numpy.uint8, numpy.int8, numpy.int32, numpy.int64, numpy.uint16, numpy.uint32, numpy.uint64):
275+
if numpy.issubdtype(centre.dtype, numpy.integer):
276276
centre = centre.astype(numpy.bool_)
277277
centre = pyarrow.array(centre, type=pyarrow.bool_())
278278
return pyarrow.compute.invert(centre)

0 commit comments

Comments
 (0)