Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
When creating a ListArray where you indicate that the values field is not nullable, you can actually create the array with nulls without this is being validated:
>>> typ = pa.list_(pa.field("element", pa.int64(), nullable=False)) >>> arr = pa.array([[1, 2], [3, 4, None]], typ) >>> arr <pyarrow.lib.ListArray object at 0x7f75bdeba760> [ [ 1, 2 ], [ 3, 4, null ] ] >>> arr.type ListType(list<element: int64 not null>)
Also explicitly validating it doesn't raise:
>>> arr.validate(full=True)
Is this something we should check?
What guarantees do we attach to the nullability of a field of a nested type?
Attachments
Issue Links
- relates to
-
ARROW-16651 [Python] Casting Table to new schema ignores nullability of fields
- Resolved