You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 91aeae8
Browse filesBrowse the repository at this point in the historyBrowse files
ARROW-15839: [C++][Python] Accept validity bitmap in ListArray.from_arrays (apache#13894)
Will close [ARROW-15839](https://issues.apache.org/jira/browse/ARROW-15839)
This will allow proper nulls in place of what is presently empty lists (on top level) when no mask is passed.
```python
import pyarrow as pa
arr = pa.array([None, [0]])
reconstructed_arr = pa.ListArray.from_arrays(arr.offsets, arr.values, mask=arr.is_null())
print(reconstructed_arr.to_pylist())
# [None, [0]]
# Currently it doesn't accept `mask` and results in `[[], [0]]` unless explicit offsets set
```
There was also discussion with @jorisvandenbossche about renaming the added `null_bitmap` to `validity_bitmap`; but this will deviate from [existing `null_bitmap` use in the same area of code](https://github.com/apache/arrow/blob/d880d7517a33f2ac8ff259cad711bc210fd570c5/cpp/src/arrow/array/array_nested.h#L113). Should I change those names now or in a later PR/issue to standardize the `null_bitmap` / `validity_buf` naming?
Lead-authored-by: Miles Granger <miles59923@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Signed-off-by: Antoine Pitrou <antoine@python.org>
0 commit comments