Skip to content

GH-49384: [Python] Respect copy=True in ChunkedArray.__array__ - #50558

Closed
jingyi-zhao-01 wants to merge 1 commit into
apache:mainfrom
jingyi-zhao-01:GH-49384-copy-true-chunkedarray
Closed

GH-49384: [Python] Respect copy=True in ChunkedArray.__array__#50558
jingyi-zhao-01 wants to merge 1 commit into
apache:mainfrom
jingyi-zhao-01:GH-49384-copy-true-chunkedarray

Conversation

@jingyi-zhao-01

@jingyi-zhao-01 jingyi-zhao-01 commented Jul 20, 2026

Copy link
Copy Markdown

Closes #49384.

This rework makes ChunkedArray.__array__(copy=True) return a real NumPy copy. In single-chunk cases the previous path could return a read-only zero-copy view.

  • Make to_numpy() result explicitly copied before return
  • Keep copy=False behavior unchanged (still raises ValueError)

@jingyi-zhao-01
jingyi-zhao-01 deleted the GH-49384-copy-true-chunkedarray branch July 20, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Python] Single chunk ChunkedArray doesn't correctly respect copy in __array__method

1 participant