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/09/01 10:35:00 UTC

[jira] [Resolved] (ARROW-15839) [C++][Python] Allow to reconstruct a ListArray with ListArray.from_arrays and keep the nulls

     [ https://issues.apache.org/jira/browse/ARROW-15839?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antoine Pitrou resolved ARROW-15839.
------------------------------------
    Fix Version/s: 10.0.0
       Resolution: Fixed

Issue resolved by pull request 13894
[https://github.com/apache/arrow/pull/13894]

> [C++][Python] Allow to reconstruct a ListArray with ListArray.from_arrays and keep the nulls
> --------------------------------------------------------------------------------------------
>
>                 Key: ARROW-15839
>                 URL: https://issues.apache.org/jira/browse/ARROW-15839
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++, Python
>    Affects Versions: 7.0.0
>            Reporter: quentin lhoest
>            Assignee: Miles Granger
>            Priority: Major
>              Labels: good-second-issue, pull-request-available
>             Fix For: 10.0.0
>
>          Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> Hi ! Right now when one wants to reconstruct a ListArray using ListArrar.from_arrays, the `null` values may be lost:
> {code:java}
> import pyarrow as pa
> arr = pa.array([None, [0]])
> reconstructed_arr = pa.ListArray.from_arrays(arr.offsets, arr.values)
> print(reconstructed_arr.to_pylist())
> # [[], [0]] {code}
> It would be nice to have a `mask` parameter to `ListArray.from_arrays` (or any way to provide the validity bitmap) to be able to reconstruct the original array with the `null` values.
> It would also be consistent with `StructArray.from_arrays` that already has the `mask` parameter.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)