[
https://issues.apache.org/jira/browse/ARROW-15202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
A. Coady updated ARROW-15202:
-----------------------------
Description:
`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))`.
was:
`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))`.
> Create pyarrow array using an object's `__array__` method.
> ----------------------------------------------------------
>
> Key: ARROW-15202
> URL: https://issues.apache.org/jira/browse/ARROW-15202
> Project: Apache Arrow
> Issue Type: New Feature
> Components: Python
> Affects Versions: 6.0.1
> Reporter: A. Coady
> Priority: Minor
>
> `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))`.
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)