friendlymatthew commented on code in PR #7757:
URL: https://github.com/apache/arrow-rs/pull/7757#discussion_r2162700336


##########
parquet-variant/src/variant/list.rs:
##########
@@ -123,7 +123,11 @@ impl<'m, 'v> VariantList<'m, 'v> {
         self.len() == 0
     }
 
-    pub fn get(&self, index: usize) -> Result<Variant<'m, 'v>, ArrowError> {
+    pub fn get(&self, index: usize) -> Option<Variant<'m, 'v>> {
+        self.get_err(index).ok()
+    }
+
+    fn get_err(&self, index: usize) -> Result<Variant<'m, 'v>, ArrowError> {

Review Comment:
   I chose this path since `VariantList::get` was used in two separate code 
paths-- 1) to retrieve the element at that index and 2) to perform validation 
in `VariantList::try_new`. 
   
   Since the latter path requires an error message, I chose to private and 
rename the fallible `get` for internal usage



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