jingyi-zhao-01 opened a new pull request, #50561:
URL: https://github.com/apache/arrow/pull/50561

   ### Rationale for this change
   
   `ChunkedArray.__array__(copy=True)` should respect NumPy's copy request. For 
a single-chunk `ChunkedArray`, the current path can return a zero-copy 
read-only NumPy view instead.
   
   Closes #49384.
   
   ### What changes are included in this PR?
   
   - Make `ChunkedArray.__array__(copy=True)` return a real NumPy copy.
   - Add a regression test for the single-chunk case.
   
   ### Are these changes tested?
   
   Yes:
   
   ```bash
   python -m pytest python/pyarrow/tests/test_table.py -q
   ```
   
   ### Are there any user-facing changes?
   
   Yes. `np.array(pa.chunked_array([[...]]), copy=True)` now returns a writable 
copied NumPy array, matching the behavior users expect from `copy=True`.
   
   ### AI assistance
   
   I used an AI coding assistant while preparing this patch. I reviewed the 
change myself, kept it scoped to `ChunkedArray.__array__`, and verified it with 
the focused PyArrow table tests above.
   


-- 
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]

Reply via email to