Details
-
Improvement
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
None
Description
The python API for creating StructArray from a list of array doesn't allow to pass a missing value mask.
At the moment the only way to create a StructArray with missing value is to use `pyarrow.array` and passing a vector of tuple.
>>> pyarrow.array( [ None, (1, "foo"), ], type=pyarrow.struct( [pyarrow.field('col1', pyarrow.int64()), pyarrow.field("col2", pyarrow.string())] ) ) -- is_valid: [ false, true ] -- child 0 type: int64 [ 0, 1 ] -- child 1 type: string [ "", "foo" ] >>> pyarrow.StructArray.from_arrays( [ [None, 1], [None, "foo"] ], fields=[pyarrow.field('col1', pyarrow.int64()), pyarrow.field("col2", pyarrow.string())] ) -- is_valid: all not null -- child 0 type: int64 [ null, 1 ] -- child 1 type: string [ null, "foo" ]
The C++ API allows it, so it should be easy to add.
see this so question
Attachments
Issue Links
- links to