You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Jim Pivarski (Jira)" <ji...@apache.org> on 2020/12/15 20:52:00 UTC

[jira] [Commented] (ARROW-10930) In pyarrow, LargeListArray doesn't have a value_field

    [ https://issues.apache.org/jira/browse/ARROW-10930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17249926#comment-17249926 ] 

Jim Pivarski commented on ARROW-10930:
--------------------------------------

Incidentally, this is what I'm using as a work-around:
{code:java}
    # if not tpe.value_field.nullable:
    if str(tpe).endswith(" not null>"):{code}
I'd rather not! Thanks!

> In pyarrow, LargeListArray doesn't have a value_field
> -----------------------------------------------------
>
>                 Key: ARROW-10930
>                 URL: https://issues.apache.org/jira/browse/ARROW-10930
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>    Affects Versions: 2.0.0
>            Reporter: Jim Pivarski
>            Priority: Major
>
> This one is easy: it looks like the LargeListType is just missing this field. Here it is for a 32-bit list (the reason I want this is to get at the "nullable" field, although the "metadata" would be nice, too):
> {code:java}
> >>> import pyarrow as pa
> >>> small_array = pa.ListArray.from_arrays(pa.array([0, 3, 3, 5]), pa.array([1.1, 2.2, 3.3, 4.4, 5.5]))
> >>> small_array.type.value_field
> pyarrow.Field<item: double>
> >>> small_array.type.value_field.nullable
> True{code}
> Now with a large list:
> {code:java}
> >>> large_array = pa.LargeListArray.from_arrays(pa.array([0, 3, 3, 5]), pa.array([1.1, 2.2, 3.3, 4.4, 5.5]))
> >>> large_array.type.value_field
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> AttributeError: 'pyarrow.lib.LargeListType' object has no attribute 'value_field'{code}
> Verifying version:
> {code:java}
> >>> pa.__version__
> '2.0.0'{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)