Skip to content

[Python] Accept keywords in ChunkedArray.to_numpy() for compatibility with Array.to_numpy() #34787

Closed

Description

@jorisvandenbossche

Describe the enhancement requested

Currently, if you have "a" pyarrow array object that can be either array or chunked array, and you call to_numpy with something that cannot be zero copy, you need to do:

if isinstance(array, pyarrow.Array):
    np_arr = array.to_numpy(zero_copy_only=False)
else:
    np_arr = array.to_numpy()

instead of simply:

np_arr = array.to_numpy(zero_copy_only=False)

because the chunked array version doesn't accept the keyword. To make this easier, I think we should just accept that keyword in ChunkedArray.to_numpy() as well (and only accept False as a possible value)

Component(s)

Python

Activity

  1. added a commit that references this issue on Jul 10, 2023
  2. added this to the 13.0.0 milestone on Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions