alamb commented on code in PR #8290:
URL: https://github.com/apache/arrow-rs/pull/8290#discussion_r2348559715


##########
arrow-cast/src/cast/mod.rs:
##########
@@ -8619,8 +8619,12 @@ mod tests {
 
         let new_array_result = cast(&array, &new_type.clone());
         assert!(!can_cast_types(array.data_type(), &new_type));
-        assert!(
-            matches!(new_array_result, Err(ArrowError::CastError(t)) if t == 
r#"Casting from Map(Field { name: "entries", data_type: Struct([Field { name: 
"key", data_type: Utf8, nullable: false, dict_id: 0, dict_is_ordered: false, 
metadata: {} }, Field { name: "value", data_type: Utf8, nullable: true, 
dict_id: 0, dict_is_ordered: false, metadata: {} }]), nullable: false, dict_id: 
0, dict_is_ordered: false, metadata: {} }, false) to Map(Field { name: 
"entries", data_type: Struct([Field { name: "key", data_type: Utf8, nullable: 
false, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: 
"value", data_type: Utf8, nullable: false, dict_id: 0, dict_is_ordered: false, 
metadata: {} }]), nullable: false, dict_id: 0, dict_is_ordered: false, 
metadata: {} }, true) not supported"#)
+        let Err(ArrowError::CastError(t)) = new_array_result else {
+            panic!();
+        };
+        assert_eq!(
+            t,
+            r#"Casting from Map(Field { "entries": Struct(key Utf8, value 
nullable Utf8) }, false) to Map(Field { "entries": Struct(key Utf8, value Utf8) 
}, true) not supported"#

Review Comment:
   that is certainly much nicer!



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