Skip to content

[Python] replace_with_mask segfaults with scalar values #55761

Backlog

Description

@AlenkaF

Describe the bug, including details regarding any error messages, version, and platform.

>>> pc.replace_with_mask(pa.scalar(1), pa.array([True]), pa.array([2]))
[1]    12012 segmentation fault  python

This code should error, not crash.
Note: with all three arguments as scalars it works:

>>> pc.replace_with_mask(pa.scalar(1), True, 2)
# Or pc.replace_with_mask(pa.scalar(1), pa.scalar(True), pa.scalar(2))
<pyarrow.lib.Int64Array object at 0x10f1a7340>
[
  2
]

Found while working on the compute stubs (#49201). Once fixed, the stubs need re-check/update.

Component(s)

Python

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions