[
https://issues.apache.org/jira/browse/ARROW-15050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17458230#comment-17458230
]
Joris Van den Bossche commented on ARROW-15050:
-----------------------------------------------
[~vladfi] thanks for the report. I think this essentially comes back to
ARROW-5295 (which is a similar issue but for arrays, but both arrays and scalar
functions for the python->arrow conversion use the same code path I think).
The current generic python->arrow conversion layer cannot handle our own
scalars, but only Python scalars (+ some numpy and pandas ones)
> [Python] pyarrow.scalar doesn't accept nested pyarrow values
> ------------------------------------------------------------
>
> Key: ARROW-15050
> URL: https://issues.apache.org/jira/browse/ARROW-15050
> Project: Apache Arrow
> Issue Type: Bug
> Components: Python
> Reporter: Vlad Firoiu
> Priority: Major
>
> Easiest explained in code:
> {code:python}
> import pyarrow as pa
> t1 = pa.struct([('x', pa.int64())])
> t2 = pa.struct([('y', t1)])
> t1_py = {'x', 0}
> t1_pa = pa.scalar(t1_py, type=t1)
> t2_py = {'y': {'x': 0}}
> t2_pa = pa.scalar(t2_py, type=t2) # works
> t2_mixed = {'y': t1_pa}
> t2_pa_mix = pa.scalar(t2_mixed, type=t2) # fails
> assert t2_pa_mix == t2_pa
> {code}
> Is there some other way to construct the pyarrow struct value corresponding
> to {{t2_pa}} given {{t1_pa}} directly, without going through python first
> (i.e. constructing {{t1_py}})?
--
This message was sent by Atlassian Jira
(v8.20.1#820001)