viirya commented on code in PR #3933:
URL: https://github.com/apache/arrow-rs/pull/3933#discussion_r1152503781


##########
arrow-array/src/array/union_array.rs:
##########
@@ -241,21 +243,29 @@ impl UnionArray {
     ///
     /// Panics if `index` is greater than the length of the array.
     pub fn type_id(&self, index: usize) -> i8 {
-        assert!(index < self.len());
-        self.data().buffers()[0].as_slice()[self.offset() + index] as i8
+        self.type_ids[index]
+    }
+
+    /// Returns the `type_ids` for this array

Review Comment:
   nit to match `offsets` :
   ```suggestion
       /// Returns the `type_ids` buffer for this array
   ```



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