scovich commented on code in PR #8611:
URL: https://github.com/apache/arrow-rs/pull/8611#discussion_r2430393691


##########
parquet-variant-compute/src/variant_array_builder.rs:
##########
@@ -162,6 +173,17 @@ impl VariantArrayBuilder {
     }
 }
 
+impl<'m, 'v> Extend<Option<Variant<'m, 'v>>> for VariantArrayBuilder {
+    fn extend<T: IntoIterator<Item = Option<Variant<'m, 'v>>>>(&mut self, 
iter: T) {

Review Comment:
   > I wonder if it's fine to just support the `Option<T>` case, as it follows 
the other builder `Extend` impls.
   
   I mean, any support is better than none. But we have existing use cases in 
the code for both `Option<T>` and `T`. 
   
   There seems to be an odd split here:
   * We have both [`impl From<Vec<Option<bool>> for 
BooleanArray`](https://docs.rs/arrow/latest/arrow/array/struct.BooleanArray.html#impl-From%3CVec%3COption%3Cbool%3E%3E%3E-for-BooleanArray)
 and [`impl From<Vec<bool>> for 
BooleanArray`](https://docs.rs/arrow/latest/arrow/array/struct.BooleanArray.html#impl-From%3CVec%3Cbool%3E%3E-for-BooleanArray)
   * But we only have [`impl FromIterator<Option<bool>> for 
BooleanArray`](https://docs.rs/arrow/latest/arrow/array/struct.BooleanArray.html#impl-FromIterator%3CPtr%3E-for-BooleanArray)
 and [`impl Extend<Option<bool> for 
BooleanBuilder`](https://docs.rs/arrow/latest/arrow/array/struct.BooleanBuilder.html#impl-Extend%3COption%3Cbool%3E%3E-for-BooleanBuilder)
   
   So maybe you're right, that to mirror existing conventions we should _not_ 
`Extend<Variant>`. And should potentially consider adding the two 
`From<Vec<...>>`?
   
   But then we basically end up implementing `Extend<Variant>` inside 
`From<Vec<Variant>>` itself... 🤷 



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