You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Xavante Erickson (Jira)" <ji...@apache.org> on 2020/11/02 18:24:00 UTC

[jira] [Resolved] (ARROW-10443) [Python] Nested dictionaries not able to be converted to table

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

Xavante Erickson resolved ARROW-10443.
--------------------------------------
    Resolution: Not A Bug

> [Python] Nested dictionaries not able to be converted to table
> --------------------------------------------------------------
>
>                 Key: ARROW-10443
>                 URL: https://issues.apache.org/jira/browse/ARROW-10443
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>    Affects Versions: 2.0.0
>         Environment: Windows 10, v. 2004. Python 3.8.5
>            Reporter: Xavante Erickson
>            Priority: Trivial
>              Labels: newbie
>
> Hi, it seems as you wanted questions and issues here and not in github.
> I was trying to convert a nested dictionary creating my own schema without success, it seems like it should and I get an unintuitive error message. When I execute the code below I get the error message "pyarrow.lib.ArrowTypeError: Could not convert b with type str: was expecting tuple of (key, value) pair"
> {code:java}
> import pyarrow as pa
> a = {'a': {'b': [1, 2, 3, 4, 5, 6], 'c': [3, 2, 1], 'd': [1, 2]}}
> struct = pa.struct([pa.field('b', pa.int32()), pa.field('c', pa.int32()), pa.field('d', pa.int32())])
> schema = pa.schema([pa.field('a', struct)])
> a_pa = pa.Table.from_pydict(a, schema)
> {code}
>  



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