asubiotto commented on code in PR #8735:
URL: https://github.com/apache/arrow-rs/pull/8735#discussion_r2472767810
##########
arrow-array/src/array/list_view_array.rs:
##########
@@ -454,6 +457,35 @@ impl<OffsetSize: OffsetSizeTrait> std::fmt::Debug for
GenericListViewArray<Offse
}
}
+impl<OffsetSize: OffsetSizeTrait> From<GenericListArray<OffsetSize>>
+ for GenericListViewArray<OffsetSize>
+{
+ fn from(value: GenericListArray<OffsetSize>) -> Self {
+ let field = match value.data_type() {
+ DataType::List(f) | DataType::LargeList(f) => Some(f.clone()),
+ _ => None,
+ }
+ .expect("Expected infallible creation of GenericListViewArray from
GenericList failed");
Review Comment:
This is reasonable. I would move the `expect` into the `_ =>` arm as a panic
so this match expression evaluates to a `Field` rather than an `Option<Field>`
--
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]