[
https://issues.apache.org/jira/browse/ARROW-9997?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17196424#comment-17196424
]
Neal Richardson commented on ARROW-9997:
----------------------------------------
{quote}I'd also prefer the mapping API, but .as_py() should not fail in any
circumstance.{quote}
Is that so? If the mapping API is the most useful thing to translate a struct
array into, and the only reason not to is the (uncommon) chance of duplicate
field names, another solution would be to make as_py() error if there are
duplicate field names. IIUC as_py is a convenience method, and since Python
objects and the Arrow format are not identical, there should be no hard
requirement that everything translate 100% faithfully. Put differently,
usability and fidelity are tradeoffs at the extremes, and we should consider
whether the benefit of increased fidelity in edge cases is worth the cost of
usability in common cases.
> [Python] StructScalar.as_py() fails if the type has duplicate field names
> -------------------------------------------------------------------------
>
> Key: ARROW-9997
> URL: https://issues.apache.org/jira/browse/ARROW-9997
> Project: Apache Arrow
> Issue Type: Bug
> Components: Python
> Reporter: Krisztian Szucs
> Assignee: Krisztian Szucs
> Priority: Major
> Fix For: 2.0.0
>
>
> {{StructScalar}} currently extends an abstract Mapping interface. Since the
> type allows duplicate field names we cannot provide that API.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)