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


##########
arrow-cast/src/cast.rs:
##########
@@ -7459,6 +7471,48 @@ mod tests {
         assert_eq!(&expected.value(2), &actual.value(2));
     }
 
+    #[test]
+    fn test_cast_nested_list_container() {
+        // large-list to list
+        let array = Arc::new(make_large_list_array()) as ArrayRef;
+        let list_array = cast(
+            &array,
+            &DataType::List(Arc::new(Field::new(
+                "",
+                DataType::List(Arc::new(Field::new("", DataType::Int32, 
false))),
+                false,
+            ))),
+        )
+        .unwrap();
+        let actual = list_array.as_any().downcast_ref::<ListArray>().unwrap();

Review Comment:
   Can we please use AsArray in tests, i.e. `.as_list::<i32>()` it is much 
easier to read



##########
arrow-cast/src/cast.rs:
##########
@@ -7459,6 +7471,48 @@ mod tests {
         assert_eq!(&expected.value(2), &actual.value(2));
     }
 
+    #[test]
+    fn test_cast_nested_list_container() {
+        // large-list to list
+        let array = Arc::new(make_large_list_array()) as ArrayRef;
+        let list_array = cast(
+            &array,
+            &DataType::List(Arc::new(Field::new(
+                "",
+                DataType::List(Arc::new(Field::new("", DataType::Int32, 
false))),

Review Comment:
   AFAICT this test simply ignores the nested list here, and is returning a 
non-nested list. This is consistent with my reading of cast_list_container



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