You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Joris Van den Bossche (Jira)" <ji...@apache.org> on 2022/09/23 16:08:00 UTC

[jira] [Created] (ARROW-17832) [Python] Construct MapArray from sequence of dicts (instead of list of tuples)

Joris Van den Bossche created ARROW-17832:
---------------------------------------------

             Summary: [Python] Construct MapArray from sequence of dicts (instead of list of tuples)
                 Key: ARROW-17832
                 URL: https://issues.apache.org/jira/browse/ARROW-17832
             Project: Apache Arrow
          Issue Type: Improvement
          Components: Python
            Reporter: Joris Van den Bossche


From https://github.com/apache/arrow/issues/14116

Creating a MapArray from a python sequence currently requires lists of tuples as values:

```
arr = pa.array([[('a', 1), ('b', 2)], [('c', 3)]], pa.map_(pa.string(), pa.int64()))
```

While I think it makes sense that the following could also work (using dicts instead):

```
arr = pa.array([{'a': 1, 'b': 2}, {'c': 3}], pa.map_(pa.string(), pa.int64()))
```



--
This message was sent by Atlassian Jira
(v8.20.10#820010)