jingyi-zhao-01 commented on issue #49384:
URL: https://github.com/apache/arrow/issues/49384#issuecomment-5010542207
I can still reproduce this on current Arrow main / local PyArrow dev build:
- pyarrow `26.0.0.dev3+gb03b4c539`
- numpy `2.5.1`
Minimal repro:
```python
import numpy as np
import pyarrow as pa
for arr in [pa.chunked_array([[2, 3]]), pa.chunked_array([[2], [3]])]:
out = np.array(arr, copy=True)
print(arr.num_chunks, out.flags.owndata, out.flags.writeable)
try:
out[0] = 99
print("mutation ok", out.tolist())
except Exception as exc:
print(type(exc).__name__, exc)
```
Observed output:
```text
1 False False
ValueError assignment destination is read-only
2 False True
mutation ok [99, 3]
```
So this still matches the earlier analysis: the single-chunk path can return
a zero-copy read-only NumPy view even when `copy=True`, while the multi-chunk
path materializes a writable array.
Minimal ask: if nobody is currently working on it, I can take a shot at a
small regression test plus a narrow fix in `ChunkedArray.__array__` to make the
single-chunk path respect `copy=True`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]