quentin lhoest created ARROW-15839:
--------------------------------------
Summary: [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: Python
Affects Versions: 7.0.0
Reporter: quentin lhoest
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.1#820001)