superserious-dev commented on code in PR #7644:
URL: https://github.com/apache/arrow-rs/pull/7644#discussion_r2140512311


##########
parquet-variant/src/variant.rs:
##########
@@ -461,9 +527,92 @@ impl<'m, 'v> Variant<'m, 'v> {
     pub fn as_int8(&self) -> Option<i8> {
         match *self {
             Variant::Int8(i) => Some(i),
-            // TODO: Add branches for type-widening/shortening when implemting 
rest of primitives for int
-            // Variant::Int16(i) => i.try_into().ok(),
-            // ...
+            Variant::Int16(i) => i.try_into().ok(),
+            Variant::Int32(i) => i.try_into().ok(),
+            Variant::Int64(i) => i.try_into().ok(),
+            _ => None,
+        }
+    }
+
+    pub fn as_int16(&self) -> Option<i16> {

Review Comment:
   These `as_*` methods could benefit from code coverage. Happy to add unit 
tests for these either in this PR or a future one. 



-- 
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-unsubscr...@arrow.apache.org

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

Reply via email to