[
https://issues.apache.org/jira/browse/ARROW-4434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17661456#comment-17661456
]
Rok Mihevc commented on ARROW-4434:
-----------------------------------
This issue has been migrated to [issue
#20993|https://github.com/apache/arrow/issues/20993] on GitHub. Please see the
[migration documentation|https://github.com/apache/arrow/issues/14542] for
further details.
> [Python] Cannot create empty StructArray via pa.StructArray.from_arrays
> -----------------------------------------------------------------------
>
> Key: ARROW-4434
> URL: https://issues.apache.org/jira/browse/ARROW-4434
> Project: Apache Arrow
> Issue Type: Bug
> Components: Python
> Reporter: Krisztian Szucs
> Assignee: Antoine Pitrou
> Priority: Major
> Labels: pull-request-available
> Fix For: 0.13.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> {code:python}
> In [5]: pa.StructArray.from_arrays([], names=[])
> ---------------------------------------------------------------------------
> ValueError Traceback (most recent call last)
> <ipython-input-5-d6fa9cf39f31> in <module>
> ----> 1 pa.StructArray.from_arrays([], names=[])
> ~/Workspace/arrow/python/pyarrow/array.pxi in
> pyarrow.lib.StructArray.from_arrays()
> 1326 num_arrays = len(arrays)
> 1327 if num_arrays == 0:
> -> 1328 raise ValueError("arrays list is empty")
> 1329
> 1330 length = len(arrays[0])
> ValueError: arrays list is empty
> {code}
> however
> {code:python}
> pa.array([], type=pa.struct([]))
> {code}
> works
--
This message was sent by Atlassian Jira
(v8.20.10#820010)