tustvold commented on code in PR #4484:
URL: https://github.com/apache/arrow-rs/pull/4484#discussion_r1258061008


##########
arrow-cast/src/cast.rs:
##########
@@ -3680,6 +3682,45 @@ fn cast_primitive_to_list<OffsetSize: OffsetSizeTrait + 
NumCast>(
     Ok(list_array)
 }
 
+/// Wraps a list array with another list array, using the specified 
`OffsetSize`.
+/// This function converts a dynamic array reference to a typed list array, 
creates a new list array
+/// with the same elements as the original array, and wraps it with another 
list array.
+fn wrap_list_array_with_another_one<OffsetSize: OffsetSizeTrait>(
+    array: &dyn Array,
+) -> Result<ArrayRef, ArrowError> {
+    let array = array.as_list::<OffsetSize>();
+    let array_data_type = array.data_type();
+    let field = Arc::new(Field::new("item", array_data_type.clone(), true));

Review Comment:
   Creating the Field inside the function is incorrect as it may not match the 
nullability or metadata on the target type



-- 
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]

Reply via email to