sameer727 commented on issue #38789:
URL: https://github.com/apache/arrow/issues/38789#issuecomment-7227067841

   Investigated the flags behavior and opened a docs PR: 
https://github.com/apache/arrow/pull/55821. The result is not always a copy: 
for a single chunk without nulls of a primitive type, 
`to_numpy(zero_copy_only=False)` returns a zero-copy **view** of the Arrow 
buffers (read-only, hence WRITEABLE=False), while multi-chunk or 
null-containing inputs return a new writable array that does not share Arrow 
memory (but still has OWNDATA=False, since the wrapped buffer belongs to the 
memory-pool allocation). So the flags reflect correct behavior — the docstring 
was wrong about always returning a copy; the PR documents the actual 
view-or-copy semantics.


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