abinash2553J commented on code in PR #11288:
URL: https://github.com/apache/arrow-rs/pull/11288#discussion_r4191769551
##########
arrow-data/src/transform/union.rs:
##########
@@ -77,23 +77,27 @@ pub(super) fn extend_nulls_dense(
let DataType::Union(fields, _) = &mutable.data_type else {
unreachable!()
};
- let first_type_id = fields
+ let null_type_id = fields
.iter()
- .next()
- .expect("union must have at least one field")
+ .find(|(_, field)| field.is_nullable())
+ .expect("cannot extend nulls in a union with no nullable field")
Review Comment:
I replaced the expect calls in the dense and sparse union null-extension
paths with ArrowError::InvalidArgumentError returns when no nullable child is
available to represent the null.
--
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]