&res created ARROW-17951:
----------------------------
Summary: Support ChunkedArray mask in replace operations
Key: ARROW-17951
URL: https://issues.apache.org/jira/browse/ARROW-17951
Project: Apache Arrow
Issue Type: Improvement
Environment: pyarrow==9.0.0
python 3.9
Reporter: &res
Replace operations (more specifically replace_with_mask) don't support chunked
array for the mask argument.
But one would expect that ReplaceMaskChunked, which support chunked array for
its input data (the data to be replaced), should also support chunked array for
its mask.
{code:java}
pc.replace_with_mask(pa.array(["a", "b"]), pa.array([True, False]),
pa.scalar("c", pa.string()))
pc.replace_with_mask(
pa.chunked_array([pa.array(["a", "b"])]),
pa.array([True, False]),
pa.scalar("c", pa.string()),
)
with pytest.raises(pa.ArrowInvalid, match=r"Mask must be array or scalar, not
ChunkedArray"):
pc.replace_with_mask(
pa.chunked_array([pa.array(["a", "b"])]),
pa.chunked_array([pa.array([True, False])]),
pa.scalar("c", pa.string()),
) {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)