[ 
https://issues.apache.org/jira/browse/ARROW-8004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17055776#comment-17055776
 ] 

Joris Van den Bossche commented on ARROW-8004:
----------------------------------------------

For a more limited use case than general objects, i.e. array-like objects, we 
could also think about checking for {{__array__}} and then convert to ListArray.

For example, now we can infer a list of lists or a list of numpy arrays, but 
will error on a list of pandas Series

> [Python] Define API for user-defined conversions of array cell values in 
> pyarrow.array
> --------------------------------------------------------------------------------------
>
>                 Key: ARROW-8004
>                 URL: https://issues.apache.org/jira/browse/ARROW-8004
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Python
>            Reporter: Wes McKinney
>            Priority: Major
>
> Consider the statement
> {code}
> pyarrow.array([v0, v1, v2, v3])
> {code}
> or correspondingly
> {code}
> pyarrow.array(pd.Series([v0, v1, v2, v3], dtype=object))
> {code}
> where {{v0, ..., v4}} are instances of types with no built-in 
> conversion-to-Arrow support in pyarrow. An API could be provided to allow 
> user-defined unboxing to a data type that the library _does_ understand (like 
> a NumPy array). One complexity is that if the unboxing is costly, we may need 
> to "keep around" the unboxed value when doing multiple passes over the data 
> (e.g. initially for type inference and then for conversion)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to