Skip to content

[Python] Create pyarrow array using an object's __array__ method. #30703

@asfimport

Description

@asfimport

pa.array supports optimized creation from an object with the __arrow_array__ method, or from a literal NumPy ndarray. But there's a performance gap if the input object has only an __array__ method, as it isn't used.
 
So the user has to know to call np.asarray first. And even if the original object could be extended to support 'arrow_array, it doesn't seems like a great workaround if all that method would do is call pa.array(np.asarray(self))`.

 

Reporter: A. Coady / @coady

Related issues:

Note: This issue was originally created as ARROW-15202. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions