You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Krisztian Szucs (Jira)" <ji...@apache.org> on 2020/09/28 09:22:00 UTC

[jira] [Resolved] (ARROW-10000) [C++][Python] Support constructing StructArray from list of key-value pairs

     [ https://issues.apache.org/jira/browse/ARROW-10000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Krisztian Szucs resolved ARROW-10000.
-------------------------------------
    Resolution: Fixed

> [C++][Python] Support constructing StructArray from list of key-value pairs
> ---------------------------------------------------------------------------
>
>                 Key: ARROW-10000
>                 URL: https://issues.apache.org/jira/browse/ARROW-10000
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: Python
>            Reporter: Krisztian Szucs
>            Priority: Major
>             Fix For: 2.0.0
>
>
> {code:python}
> item = [
>     ('a', 1),
>     ('b', 2)
> ]
> ty = pa.struct([
>     pa.field('a', type=pa.int8()),
>     pa.field('b', type=pa.float64())
> ])
> pa.array([item], type=ty)
> {code}
> raises 
> {code}
> ArrowTypeError: Could not convert [('a', 1), ('b', 2)] with type list: was not a dict, tuple, or recognized null value for conversion to struct type
> {code}
> This feature is required for {{pa.repeat(scalar, n)}} roundtrip if the type contains duplicated field names.



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