waynexia commented on PR #5616: URL: https://github.com/apache/arrow-rs/pull/5616#issuecomment-2045204518
> I'm honestly not sure about the need for this, given `schema.try_field(i)` is not appreciably less verbose than `schema.fields().get(i)` which also has the advantage of returning `FieldRef` I thought the current `field()` was kind of an "unsafe" function, and maybe `field_unchecked()` is more suitable. It's easy to find and call this method. But panicking here would be hard to debug as the panic info is just an out-of-bounds. Given it's a long-exist public API I add the new `try_field()` with some hint in `field()` so we don't break the public interface. I'd like to propose deprecating and removing/marking it unsafe `field()` as the next step. As you said users can always `schema.fields()[i]`, but we will not provide an easy-to-called unsafe API. -- 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]
