[
https://issues.apache.org/jira/browse/ARROW-16611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Antoine Pitrou updated ARROW-16611:
-----------------------------------
Summary: [Python] MapArray pandas round trip is broken (was: MapArray
pandas round trip is broken)
> [Python] MapArray pandas round trip is broken
> ---------------------------------------------
>
> Key: ARROW-16611
> URL: https://issues.apache.org/jira/browse/ARROW-16611
> Project: Apache Arrow
> Issue Type: Bug
> Components: Python
> Affects Versions: 8.0.0
> Reporter: Robbie Gruener
> Priority: Minor
>
> pyarrow.MapArray when converted to pandas cannot be successfully converted
> back.
> The following snipper does not work:
>
> ```
> import pyarrow as pa
> data = [[('x', 1), ('y', 0)], [('a', 2), ('b', 45)]]
> ty = pa.map_(pa.string(), pa.int64())
> map_col = pa.array(data, type=ty)
> pa.MapArray.from_pandas(map_col.to_pandas())
> ```
> `Uncaught exception: ArrowTypeError: Expected bytes, got a 'int' object
> (java.lang.RuntimeException)`
--
This message was sent by Atlassian Jira
(v8.20.7#820007)