Rich-T-kid commented on code in PR #10840:
URL: https://github.com/apache/arrow-rs/pull/10840#discussion_r3873273042


##########
arrow-schema/src/datatype_display.rs:
##########
@@ -474,24 +490,34 @@ mod tests {
 
     #[test]
     fn test_display_run_end_encoded() {
+        // Compact form: default field names "run_ends" and "values"
         let run_ends_field = Arc::new(Field::new("run_ends", DataType::UInt32, 
false));
         let values_field = Arc::new(Field::new("values", DataType::Int32, 
true));
-        let ree_data_type = DataType::RunEndEncoded(run_ends_field.clone(), 
values_field.clone());
-        let ree_data_type_string = ree_data_type.to_string();
-        let expected_string = "RunEndEncoded(\"run_ends\": non-null UInt32, 
\"values\": Int32)";
-        assert_eq!(ree_data_type_string, expected_string);
+        let ree = DataType::RunEndEncoded(run_ends_field.clone(), 
values_field.clone());
+        assert_eq!(ree.to_string(), "RunEndEncoded(UInt32, Int32)");
+
+        // Compact form: non-null values
+        let run_ends_field = Arc::new(Field::new("run_ends", DataType::Int32, 
false));
+        let values_field_str = Arc::new(Field::new("values", DataType::Utf8, 
false));
+        let ree2 = DataType::RunEndEncoded(run_ends_field, values_field_str);
+        assert_eq!(ree2.to_string(), "RunEndEncoded(Int32, non-null Utf8)");
+
+        // Verbose form: non-default field name on values
+        let run_ends_field = Arc::new(Field::new("run_ends", DataType::Int32, 
false));
+        let named_values = Arc::new(Field::new("named_values", DataType::Utf8, 
false));
+        let ree3 = DataType::RunEndEncoded(run_ends_field, named_values);
+        assert_eq!(
+            ree3.to_string(),
+            "RunEndEncoded('run_ends': Int32, 'named_values': non-null Utf8)"

Review Comment:
   will switch



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