alamb opened a new issue, #7701:
URL: https://github.com/apache/arrow-rs/issues/7701

   **Describe the bug**
   The `VariantBuilder` code will panic if you try and append an existing 
Object or LIst
   
   **To Reproduce**
   Add this test to `parquet-variant/src/builder.rs`"
   ```rust
       #[test]
       fn test_append_object() {
           let (object_metadata, object_value) = {
               let mut builder = VariantBuilder::new();
               let mut obj = builder.new_object();
               obj.append_value("name", "John");
               obj.finish();
               builder.finish()
           };
           let object_variant = Variant::try_new(&object_metadata, 
&object_value).unwrap();
   
           let mut builder = VariantBuilder::new();
           builder.append_value(object_variant.clone());
           let (metadata, value) = builder.finish();
           let variant = Variant::try_new(&metadata, &value).unwrap();
           assert_eq!(variant, object_variant);
       }
   }
   ```
   
   This results in 
   
   ```
   internal error: entered unreachable code: Object and List variants cannot be 
created through Into<Variant>
   thread 'builder::tests::test_append_object' panicked at 
parquet-variant/src/builder.rs:395:17:
   ```
   
   **Expected behavior**
   I expect the object variant to be copied to the in progress builder
   
   **Additional context**
   <!--
   Add any other context about the problem here.
   -->


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