amitvijapur opened a new pull request, #11178: URL: https://github.com/apache/arrow-rs/pull/11178
# Which issue does this PR close? Closes #6538. # Rationale for this change `GenericListArray::try_new` and `GenericListViewArray::try_new` reject a non-nullable `field` whenever `values.is_nullable()` is true. `Array::is_nullable` may return `true` conservatively, and `DictionaryArray::is_nullable` does so when the keys carry a null buffer, even an all-valid one, or when the values hold a null that no key references. Such a dictionary has zero logical nulls and is rejected anyway. The `UnionArray` case in the issue no longer reproduces: #6540 made `UnionArray::is_nullable` ask its children. The dictionary case still does. # What changes are included in this PR? Both constructors test `values.logical_null_count() != 0` instead, which is what `FixedSizeListArray::try_new` already checks through `logical_nulls()`. The doc bullets are updated to match. # Are these changes tested? A test in each file builds a list over an `Int8DictionaryArray` whose keys have an all-valid null buffer under a non-nullable field, which failed before the change, and then one with a null key, which still fails with `cannot contain nulls`. `cargo test -p arrow-array` passes. # Are there any user-facing changes? A list or list-view array over a dictionary with no logical nulls can now be built under a non-nullable field. Arrays that hold a logical null are still rejected as before. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
