You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Antoine Pitrou (Jira)" <ji...@apache.org> on 2022/05/18 20:24:00 UTC
[jira] [Commented] (ARROW-16611) [Python] MapArray pandas round trip is broken
[ https://issues.apache.org/jira/browse/ARROW-16611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17539065#comment-17539065 ]
Antoine Pitrou commented on ARROW-16611:
----------------------------------------
Hmm, where does the "java.lang.RuntimeException" come from?
> [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: Major
>
> 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)