Jefffrey commented on code in PR #12256:
URL: https://github.com/apache/arrow-rs/pull/12256#discussion_r4626713062


##########
arrow-schema/src/schema.rs:
##########
@@ -908,6 +906,46 @@ mod tests {
         assert_eq!(schema, expected);
     }
 
+    #[test]
+    fn normalize_inherits_parent_nullability() {
+        for parent_nullable in [false, true] {
+            for middle_nullable in [false, true] {
+                for child_nullable in [false, true] {
+                    for data_type in [DataType::Int32, 
DataType::new_list(DataType::Int32, false)] {
+                        let child = Field::new("child", data_type.clone(), 
child_nullable);
+                        let middle =
+                            Field::new_struct("middle", vec![child.clone()], 
middle_nullable);
+                        let sibling = Field::new("sibling", DataType::Int32, 
false);
+                        let schema = Schema::new(vec![
+                            Field::new_struct("parent", vec![middle], 
parent_nullable),
+                            sibling.clone(),
+                        ]);
+                        for max_level in [None, Some(0), Some(1), Some(2)] {
+                            let expected_field = if max_level == Some(1) {

Review Comment:
   why does expected depend only on `max_level` being `Some(1)`?



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