scovich commented on code in PR #7704:
URL: https://github.com/apache/arrow-rs/pull/7704#discussion_r2155515181


##########
parquet-variant/src/variant.rs:
##########
@@ -1527,26 +1372,21 @@ mod tests {
         let md = VariantMetadata::try_new(bytes).expect("should parse");
         assert_eq!(md.dictionary_size(), 2);
         // Fields
-        assert_eq!(md.get_field_by(0).unwrap(), "cat");
-        assert_eq!(md.get_field_by(1).unwrap(), "dog");
+        assert_eq!(md.get(0).unwrap(), "cat");
+        assert_eq!(md.get(1).unwrap(), "dog");
 
         // Offsets
-        assert_eq!(md.get_offset_by(0).unwrap(), 0x00);
-        assert_eq!(md.get_offset_by(1).unwrap(), 0x03);
-        // We only have 2 keys, the final offset should not be accessible 
using this method.
-        let err = md.get_offset_by(2).unwrap_err();
+        assert_eq!(md.get_offset(0).unwrap(), 0x00);
+        assert_eq!(md.get_offset(1).unwrap(), 0x03);
+        assert_eq!(md.get_offset(2).unwrap(), 0x06);
 
+        let err = md.get_offset(3);
         assert!(
-            matches!(err, ArrowError::InvalidArgumentError(ref msg)
-                     if msg.contains("Index 2 out of bounds for dictionary of 
length 2")),
-            "unexpected error: {err:?}"
+            matches!(err, Err(ArrowError::InvalidArgumentError(_))),

Review Comment:
   Actually... I changed that. Will revert back.



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