jdockerty commented on issue #8418:
URL: https://github.com/apache/arrow-rs/issues/8418#issuecomment-3329057301

   Looking at the 
[`is_positive`](https://doc.rust-lang.org/std/primitive.i32.html#method.is_positive)
 for a definition in the stdlib, it looks like it aligns with what you're 
saying too. Highlight is my own:
   
   > Returns `true` if `self` is positive and `false` **if the number is zero 
or negative.**
   
   Part of the validation of `UnionArray::try_new` also ensures that offsets 
are non-negative. `offset < 0`, i.e. must be 0 or greater, otherwise an error 
is returned.
   
   
https://github.com/apache/arrow-rs/blob/f7ea0aa815d24ab1cf66bfebe92c4c85f891e4d1/arrow-array/src/array/union_array.rs#L230-L235
   
   In the case that 0 is also valid, I think non-negative makes more sense 
here. I can raise a PR for more eyes on 👍 


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