emilk commented on code in PR #10656:
URL: https://github.com/apache/arrow-rs/pull/10656#discussion_r3766413427
##########
arrow-array/src/array/mod.rs:
##########
@@ -265,6 +268,11 @@ pub unsafe trait Array: std::fmt::Debug + Send + Sync {
/// let array = NullArray::new(1);
/// assert_eq!(array.is_null(0), false);
/// ```
+ ///
+ /// # Panics
+ ///
+ /// Panics if `index >= self.len()` and this array has a null buffer.
+ /// Arrays without a null buffer do not bounds check `index`.
Review Comment:
Fair point, reworded. The contract is now `Panics if `index >= self.len()``,
with a note that arrays lacking a null buffer currently return `false`/`true`
instead of panicking and that callers must not rely on it, so the inconsistency
stays fixable.
— Claude
--
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]