friendlymatthew commented on issue #7806: URL: https://github.com/apache/arrow-rs/issues/7806#issuecomment-3591626312
> Is this `panic!` useful, or can it be returned as an `Err(General())` like other branches in this function? If we do want to `panic!` is this reachable? > > [arrow-rs/parquet/src/schema/visitor.rs](https://github.com/apache/arrow-rs/blob/5595019bad5f7fa8c75106d31bf86c8c99d2822c/parquet/src/schema/visitor.rs#L54) > > Line 54 in [5595019](/apache/arrow-rs/commit/5595019bad5f7fa8c75106d31bf86c8c99d2822c) > > panic!("{list_type:?} is a list type and must be a group type") Hi hi, I expect users would never hit this branch. Looking at some test cases, it's [probably expected](https://github.com/apache/arrow-rs/blob/d76bfb17715261a9c907d1f5187d25a1de21df35/parquet/src/schema/visitor.rs#L234) that users call `TypeVisitor::dispatch` which in turn calls `TypeVisitor::visit_list` and other specialized methods But since the [trait is public](https://arrow.apache.org/rust/parquet/schema/visitor/trait.TypeVisitor.html), it's definitely possible to panic. Ideally I think it should be an `unreachable!` but since `TypeVisitor::visit_list` already returns a `Result`, we could just return `Err(General(_))` -- 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]
