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

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

Xavante Erickson created ARROW-10443:
----------------------------------------

             Summary: 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


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)