Inconsistency between comments and code implementation #5430
Labels
arrow
Changes to the arrow crate
bug
documentation
Improvements or additions to documentation
good first issue
Good for newcomers
help wanted
I noticed a possible panic due to inconsistency between comments and code implementation in arrow-rs/arrow-array/src/array/union_array.rs. The details can be found in the following code.
I think this function should check whether index is out of bounds as your comment read before it is used as self.type_ids[index], which could avoid unnecessary panic.
By the way, I think it would be more complete if the comment is modified to
Panics if index is greater than or equal to the length of the array.
instead ofPanics if index is greater than the length of the array.
The text was updated successfully, but these errors were encountered: