You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/15 00:52:54 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3113: Include field name in merge error message

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


##########
arrow-schema/src/field.rs:
##########
@@ -443,6 +443,15 @@ mod test {
     use std::collections::hash_map::DefaultHasher;
     use std::hash::{Hash, Hasher};
 
+    #[test]
+    fn test_merge_incompatible_types() {
+        let mut field = Field::new("c1", DataType::Int64, false);
+        let result = field
+            .try_merge(&Field::new("c1", DataType::Float32, true))
+            .expect_err("should fail");
+        assert_eq!("Schema error: Fail to merge schema field 'c1' because the from data_type = Float32 does not equal Int64", format!("{}", result));

Review Comment:
   ```suggestion
           assert_eq!("Schema error: Fail to merge schema field 'c1' because the from data_type = Float32 does not equal Int64", "{}", result);
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org