Repository: apache/arrow-rs (2025-08-23T11:07:37Z)

Issue:
Make `ObjectBuilder::finish` signature infallible
Once 
* https://github.com/apache/arrow-rs/issues/8180 

is addressed, the method can no longer fail and no longer needs to return a `Result`.


Discussion:
take



Patch:
diff --git a/parquet-variant-compute/src/cast_to_variant.rs b/parquet-variant-compute/src/cast_to_variant.rs
index c02aad898429..abc9a863e1ea 100644
--- a/parquet-variant-compute/src/cast_to_variant.rs
+++ b/parquet-variant-compute/src/cast_to_variant.rs
@@ -374,7 +374,7 @@ pub fn cast_to_variant(input: &dyn Array) -> Result<VariantArray, ArrowError> {
                     // to match Arrow struct semantics where null fields are omitted
                 }
 
-                object_builder.finish()?;
+                object_builder.finish();
                 let (metadata, value) = variant_builder.finish();
                 let variant = Variant::try_new(&metadata, &value)?;
                 builder.append_variant(variant);
@@ -440,7 +440,7 @@ pub fn cast_to_variant(input: &dyn Array) -> Result<VariantArray, ArrowError> {
                         let value = values.value(i as usize);
                         object_builder.insert(key_strings.value(i as usize), value);
                     }
-                    object_builder.finish()?;
+                    object_builder.finish();
                     let (metadata, value) = variant_builder.finish();
                     let variant = Variant::try_new(&metadata, &value)?;
 
diff --git a/parquet-variant-compute/src/from_json.rs b/parquet-variant-compute/src/from_json.rs
index 8512620f4631..fb5fe320733f 100644
--- a/parquet-variant-compute/src/from_json.rs
+++ b/parquet-variant-compute/src/from_json.rs
@@ -102,7 +102,7 @@ mod test {
             let mut vb = VariantBuilder::new();
             let mut ob = vb.new_object();
             ob.insert("a", Variant::Int8(32));
-            ob.finish()?;
+            ob.finish();
             let (object_metadata, object_value) = vb.finish();
             let expected = Variant::new(&object_metadata, &object_value);
             assert_eq!(variant_array.value(2), expected);
@@ -151,7 +151,7 @@ mod test {
             let mut vb = VariantBuilder::new();
             let mut ob = vb.new_object();
             ob.insert("a", Variant::Int8(32));
-            ob.finish()?;
+            ob.finish();
             let (object_metadata, object_value) = vb.finish();
             let expected = Variant::new(&object_metadata, &object_value);
             assert_eq!(variant_array.value(2), expected);
@@ -200,7 +200,7 @@ mod test {
             let mut vb = VariantBuilder::new();
             let mut ob = vb.new_object();
             ob.insert("a", Variant::Int8(32));
-            ob.finish()?;
+            ob.finish();
             let (object_metadata, object_value) = vb.finish();
             let expected = Variant::new(&object_metadata, &object_value);
             assert_eq!(variant_array.value(2), expected);
diff --git a/parquet-variant-compute/src/variant_array_builder.rs b/parquet-variant-compute/src/variant_array_builder.rs
index e0945271d625..d5f578421ed3 100644
--- a/parquet-variant-compute/src/variant_array_builder.rs
+++ b/parquet-variant-compute/src/variant_array_builder.rs
@@ -50,8 +50,7 @@ use std::sync::Arc;
 /// let mut vb = builder.variant_builder();
 /// vb.new_object()
 ///   .with_field("foo", "bar")
-///   .finish()
-///   .unwrap();
+///   .finish();
 ///  vb.finish(); // must call finish to write the variant to the buffers
 ///
 /// // create the final VariantArray
@@ -172,8 +171,7 @@ impl VariantArrayBuilder {
     /// variant_builder
     ///     .new_object()
     ///     .with_field("my_field", 42i64)
-    ///     .finish()
-    ///     .unwrap();
+    ///     .finish();
     /// variant_builder.finish();
     ///
     /// // finalize the array
@@ -319,11 +317,7 @@ mod test {
 
         // let's make a sub-object in the next row
         let mut sub_builder = builder.variant_builder();
-        sub_builder
-            .new_object()
-            .with_field("foo", "bar")
-            .finish()
-            .unwrap();
+        sub_builder.new_object().with_field("foo", "bar").finish();
         sub_builder.finish(); // must call finish to write the variant to the buffers
 
         // append a new list
@@ -357,29 +351,17 @@ mod test {
 
         // make a sub-object in the first row
         let mut sub_builder = builder.variant_builder();
-        sub_builder
-            .new_object()
-            .with_field("foo", 1i32)
-            .finish()
-            .unwrap();
+        sub_builder.new_object().with_field("foo", 1i32).finish();
         sub_builder.finish(); // must call finish to write the variant to the buffers
 
         // start appending an object but don't finish
         let mut sub_builder = builder.variant_builder();
-        sub_builder
-            .new_object()
-            .with_field("bar", 2i32)
-            .finish()
-            .unwrap();
+        sub_builder.new_object().with_field("bar", 2i32).finish();
         drop(sub_builder); // drop the sub builder without finishing it
 
         // make a third sub-object (this should reset the previous unfinished object)
         let mut sub_builder = builder.variant_builder();
-        sub_builder
-            .new_object()
-            .with_field("baz", 3i32)
-            .finish()
-            .unwrap();
+        sub_builder.new_object().with_field("baz", 3i32).finish();
         sub_builder.finish(); // must call finish to write the variant to the buffers
 
         let variant_array = builder.build();
diff --git a/parquet-variant-json/src/from_json.rs b/parquet-variant-json/src/from_json.rs
index 164d9b5facaf..90b26f7d307b 100644
--- a/parquet-variant-json/src/from_json.rs
+++ b/parquet-variant-json/src/from_json.rs
@@ -126,7 +126,7 @@ fn append_json(json: &Value, builder: &mut impl VariantBuilderExt) -> Result<(),
                 };
                 append_json(value, &mut field_builder)?;
             }
-            obj_builder.finish()?;
+            obj_builder.finish();
         }
     };
     Ok(())
@@ -489,7 +489,7 @@ mod test {
         let mut list_builder = variant_builder.new_list();
         let mut object_builder_inner = list_builder.new_object();
         object_builder_inner.insert("age", Variant::Int8(32));
-        object_builder_inner.finish().unwrap();
+        object_builder_inner.finish();
         list_builder.append_value(Variant::Int16(128));
         list_builder.append_value(Variant::BooleanFalse);
         list_builder.finish();
@@ -553,7 +553,7 @@ mod test {
         let mut object_builder = variant_builder.new_object();
         object_builder.insert("a", Variant::Int8(3));
         object_builder.insert("b", Variant::Int8(2));
-        object_builder.finish().unwrap();
+        object_builder.finish();
         let (metadata, value) = variant_builder.finish();
         let variant = Variant::try_new(&metadata, &value)?;
         JsonToVariantTest {
@@ -577,7 +577,7 @@ mod test {
         inner_list_builder.append_value(Variant::Double(-3e0));
         inner_list_builder.append_value(Variant::Double(1001e-3));
         inner_list_builder.finish();
-        object_builder.finish().unwrap();
+        object_builder.finish();
         let (metadata, value) = variant_builder.finish();
         let variant = Variant::try_new(&metadata, &value)?;
         JsonToVariantTest {
@@ -643,9 +643,9 @@ mod test {
                 }
                 list_builder.finish();
             });
-            inner_object_builder.finish().unwrap();
+            inner_object_builder.finish();
         });
-        object_builder.finish().unwrap();
+        object_builder.finish();
         let (metadata, value) = variant_builder.finish();
         let variant = Variant::try_new(&metadata, &value)?;
 
@@ -669,7 +669,7 @@ mod test {
         let mut object_builder = variant_builder.new_object();
         object_builder.insert("a", Variant::Int8(1));
         object_builder.insert("爱", Variant::ShortString(ShortString::try_new("अ")?));
-        object_builder.finish().unwrap();
+        object_builder.finish();
         let (metadata, value) = variant_builder.finish();
         let variant = Variant::try_new(&metadata, &value)?;
 
diff --git a/parquet-variant-json/src/to_json.rs b/parquet-variant-json/src/to_json.rs
index b1894a64f837..b9f5364cf5b6 100644
--- a/parquet-variant-json/src/to_json.rs
+++ b/parquet-variant-json/src/to_json.rs
@@ -966,8 +966,7 @@ mod tests {
             .with_field("age", 30i32)
             .with_field("active", true)
             .with_field("score", 95.5f64)
-            .finish()
-            .unwrap();
+            .finish();
 
         let (metadata, value) = builder.finish();
         let variant = Variant::try_new(&metadata, &value)?;
@@ -997,7 +996,7 @@ mod tests {
 
         {
             let obj = builder.new_object();
-            obj.finish().unwrap();
+            obj.finish();
         }
 
         let (metadata, value) = builder.finish();
@@ -1022,8 +1021,7 @@ mod tests {
             .with_field("message", "Hello \"World\"\nWith\tTabs")
             .with_field("path", "C:\\Users\\Alice\\Documents")
             .with_field("unicode", "😀 Smiley")
-            .finish()
-            .unwrap();
+            .finish();
 
         let (metadata, value) = builder.finish();
         let variant = Variant::try_new(&metadata, &value)?;
@@ -1135,7 +1133,7 @@ mod tests {
             obj.insert("zebra", "last");
             obj.insert("alpha", "first");
             obj.insert("beta", "second");
-            obj.finish().unwrap();
+            obj.finish();
         }
 
         let (metadata, value) = builder.finish();
@@ -1202,7 +1200,7 @@ mod tests {
             obj.insert("float_field", 2.71f64);
             obj.insert("null_field", ());
             obj.insert("long_field", 999i64);
-            obj.finish().unwrap();
+            obj.finish();
         }
 
         let (metadata, value) = builder.finish();
diff --git a/parquet-variant/benches/variant_builder.rs b/parquet-variant/benches/variant_builder.rs
index a42327fe1335..5d00cc054e55 100644
--- a/parquet-variant/benches/variant_builder.rs
+++ b/parquet-variant/benches/variant_builder.rs
@@ -77,7 +77,7 @@ fn bench_object_field_names_reverse_order(c: &mut Criterion) {
                 object_builder.insert(format!("{}", 1000 - i).as_str(), string_table.next());
             }
 
-            object_builder.finish().unwrap();
+            object_builder.finish();
             hint::black_box(variant.finish());
         })
     });
@@ -113,7 +113,7 @@ fn bench_object_same_schema(c: &mut Criterion) {
                 inner_list_builder.append_value(string_table.next());
 
                 inner_list_builder.finish();
-                object_builder.finish().unwrap();
+                object_builder.finish();
 
                 hint::black_box(variant.finish());
             }
@@ -154,7 +154,7 @@ fn bench_object_list_same_schema(c: &mut Criterion) {
                 list_builder.append_value(string_table.next());
 
                 list_builder.finish();
-                object_builder.finish().unwrap();
+                object_builder.finish();
             }
 
             list_builder.finish();
@@ -189,7 +189,7 @@ fn bench_object_unknown_schema(c: &mut Criterion) {
                             let key = string_table.next();
                             inner_object_builder.insert(key, key);
                         }
-                        inner_object_builder.finish().unwrap();
+                        inner_object_builder.finish();
 
                         continue;
                     }
@@ -202,7 +202,7 @@ fn bench_object_unknown_schema(c: &mut Criterion) {
 
                     inner_list_builder.finish();
                 }
-                object_builder.finish().unwrap();
+                object_builder.finish();
                 hint::black_box(variant.finish());
             }
         })
@@ -241,7 +241,7 @@ fn bench_object_list_unknown_schema(c: &mut Criterion) {
                             let key = string_table.next();
                             inner_object_builder.insert(key, key);
                         }
-                        inner_object_builder.finish().unwrap();
+                        inner_object_builder.finish();
 
                         continue;
                     }
@@ -254,7 +254,7 @@ fn bench_object_list_unknown_schema(c: &mut Criterion) {
 
                     inner_list_builder.finish();
                 }
-                object_builder.finish().unwrap();
+                object_builder.finish();
             }
 
             list_builder.finish();
@@ -314,10 +314,10 @@ fn bench_object_partially_same_schema(c: &mut Criterion) {
                         let key = string_table.next();
                         inner_object_builder.insert(key, key);
                     }
-                    inner_object_builder.finish().unwrap();
+                    inner_object_builder.finish();
                 }
 
-                object_builder.finish().unwrap();
+                object_builder.finish();
                 hint::black_box(variant.finish());
             }
         })
@@ -376,10 +376,10 @@ fn bench_object_list_partially_same_schema(c: &mut Criterion) {
                         let key = string_table.next();
                         inner_object_builder.insert(key, key);
                     }
-                    inner_object_builder.finish().unwrap();
+                    inner_object_builder.finish();
                 }
 
-                object_builder.finish().unwrap();
+                object_builder.finish();
             }
 
             list_builder.finish();
@@ -408,7 +408,7 @@ fn bench_validation_validated_vs_unvalidated(c: &mut Criterion) {
         }
         list.finish();
 
-        obj.finish().unwrap();
+        obj.finish();
         test_data.push(builder.finish());
     }
 
@@ -462,7 +462,7 @@ fn bench_iteration_performance(c: &mut Criterion) {
         let mut obj = list.new_object();
         obj.insert(&format!("field_{i}"), rng.random::<i32>());
         obj.insert("nested_data", format!("data_{i}").as_str());
-        obj.finish().unwrap();
+        obj.finish();
     }
     list.finish();
 
diff --git a/parquet-variant/benches/variant_validation.rs b/parquet-variant/benches/variant_validation.rs
index 0ccc10117898..dcf7681a76ed 100644
--- a/parquet-variant/benches/variant_validation.rs
+++ b/parquet-variant/benches/variant_validation.rs
@@ -40,9 +40,9 @@ fn generate_large_object() -> (Vec<u8>, Vec<u8>) {
             }
             list_builder.finish();
         }
-        inner_object.finish().unwrap();
+        inner_object.finish();
     }
-    outer_object.finish().unwrap();
+    outer_object.finish();
 
     variant_builder.finish()
 }
@@ -72,9 +72,9 @@ fn generate_complex_object() -> (Vec<u8>, Vec<u8>) {
         let key = format!("{}", 1024 - i);
         inner_object_builder.insert(&key, i);
     }
-    inner_object_builder.finish().unwrap();
+    inner_object_builder.finish();
 
-    object_builder.finish().unwrap();
+    object_builder.finish();
 
     variant_builder.finish()
 }
diff --git a/parquet-variant/src/builder.rs b/parquet-variant/src/builder.rs
index f6555a9a0559..2fa8d0981c5b 100644
--- a/parquet-variant/src/builder.rs
+++ b/parquet-variant/src/builder.rs
@@ -282,7 +282,7 @@ impl ValueBuilder {
             object_builder.insert(field_name, value);
         }
 
-        object_builder.finish().unwrap();
+        object_builder.finish();
     }
 
     fn try_append_object(state: ParentState<'_>, obj: VariantObject) -> Result<(), ArrowError> {
@@ -293,7 +293,8 @@ impl ValueBuilder {
             object_builder.try_insert(field_name, value)?;
         }
 
-        object_builder.finish()
+        object_builder.finish();
+        Ok(())
     }
 
     fn append_list(state: ParentState<'_>, list: VariantList) {
@@ -1124,7 +1125,7 @@ impl Drop for ParentState<'_> {
 /// obj.insert("name", "Alice");
 /// obj.insert("age", 30);
 /// obj.insert("score", 95.5);
-/// obj.finish().unwrap();
+/// obj.finish();
 ///
 /// let (metadata, value) = builder.finish();
 /// let variant = Variant::try_new(&metadata, &value).unwrap();
@@ -1142,7 +1143,7 @@ impl Drop for ParentState<'_> {
 /// obj.insert("name", "Bob"); // field id = 3
 /// obj.insert("age", 25);
 /// obj.insert("score", 88.0);
-/// obj.finish().unwrap();
+/// obj.finish();
 ///
 /// let (metadata, value) = builder.finish();
 /// let variant = Variant::try_new(&metadata, &value).unwrap();
@@ -1634,7 +1635,7 @@ impl<'a> ObjectBuilder<'a> {
     }
 
     /// Finalizes this object and appends it to its parent, which otherwise remains unmodified.
-    pub fn finish(mut self) -> Result<(), ArrowError> {
+    pub fn finish(mut self) {
         let metadata_builder = self.parent_state.metadata_builder();
 
         self.fields.sort_by(|&field_a_id, _, &field_b_id, _| {
@@ -1697,8 +1698,6 @@ impl<'a> ObjectBuilder<'a> {
                 offset_size,
             );
         self.parent_state.finish();
-
-        Ok(())
     }
 }
 
@@ -1906,8 +1905,7 @@ mod tests {
             .new_object()
             .with_field("name", "John")
             .with_field("age", 42i8)
-            .finish()
-            .unwrap();
+            .finish();
 
         let (metadata, value) = builder.finish();
         assert!(!metadata.is_empty());
@@ -1923,8 +1921,7 @@ mod tests {
             .with_field("zebra", "stripes")
             .with_field("apple", "red")
             .with_field("banana", "yellow")
-            .finish()
-            .unwrap();
+            .finish();
 
         let (_, value) = builder.finish();
 
@@ -1948,8 +1945,7 @@ mod tests {
             .new_object()
             .with_field("name", "Ron Artest")
             .with_field("name", "Metta World Peace") // Duplicate field
-            .finish()
-            .unwrap();
+            .finish();
 
         let (metadata, value) = builder.finish();
         let variant = Variant::try_new(&metadata, &value).unwrap();
@@ -2068,15 +2064,13 @@ mod tests {
             .new_object()
             .with_field("id", 1)
             .with_field("type", "Cauliflower")
-            .finish()
-            .unwrap();
+            .finish();
 
         list_builder
             .new_object()
             .with_field("id", 2)
             .with_field("type", "Beets")
-            .finish()
-            .unwrap();
+            .finish();
 
         list_builder.finish();
 
@@ -2113,17 +2107,9 @@ mod tests {
 
         let mut list_builder = builder.new_list();
 
-        list_builder
-            .new_object()
-            .with_field("a", 1)
-            .finish()
-            .unwrap();
+        list_builder.new_object().with_field("a", 1).finish();
 
-        list_builder
-            .new_object()
-            .with_field("b", 2)
-            .finish()
-            .unwrap();
+        list_builder.new_object().with_field("b", 2).finish();
 
         list_builder.finish();
 
@@ -2169,7 +2155,7 @@ mod tests {
         {
             let mut object_builder = list_builder.new_object();
             object_builder.insert("a", 1);
-            let _ = object_builder.finish();
+            object_builder.finish();
         }
 
         list_builder.append_value(2);
@@ -2177,7 +2163,7 @@ mod tests {
         {
             let mut object_builder = list_builder.new_object();
             object_builder.insert("b", 2);
-            let _ = object_builder.finish();
+            object_builder.finish();
         }
 
         list_builder.append_value(3);
@@ -2227,10 +2213,10 @@ mod tests {
             {
                 let mut inner_object_builder = outer_object_builder.new_object("c");
                 inner_object_builder.insert("b", "a");
-                let _ = inner_object_builder.finish();
+                inner_object_builder.finish();
             }
 
-            let _ = outer_object_builder.finish();
+            outer_object_builder.finish();
         }
 
         let (metadata, value) = builder.finish();
@@ -2269,11 +2255,11 @@ mod tests {
                 inner_object_builder.insert("b", false);
                 inner_object_builder.insert("c", "a");
 
-                let _ = inner_object_builder.finish();
+                inner_object_builder.finish();
             }
 
             outer_object_builder.insert("b", false);
-            let _ = outer_object_builder.finish();
+            outer_object_builder.finish();
         }
 
         let (metadata, value) = builder.finish();
@@ -2317,10 +2303,10 @@ mod tests {
                     .with_value(false)
                     .finish();
 
-                let _ = inner_object_builder.finish();
+                inner_object_builder.finish();
             }
 
-            let _ = outer_object_builder.finish();
+            outer_object_builder.finish();
         }
 
         let (metadata, value) = builder.finish();
@@ -2380,15 +2366,15 @@ mod tests {
                 {
                     let mut inner_inner_object_builder = inner_object_builder.new_object("c");
                     inner_inner_object_builder.insert("aa", "bb");
-                    let _ = inner_inner_object_builder.finish();
+                    inner_inner_object_builder.finish();
                 }
 
                 {
                     let mut inner_inner_object_builder = inner_object_builder.new_object("d");
                     inner_inner_object_builder.insert("cc", "dd");
-                    let _ = inner_inner_object_builder.finish();
+                    inner_inner_object_builder.finish();
                 }
-                let _ = inner_object_builder.finish();
+                inner_object_builder.finish();
             }
 
             outer_object_builder.insert("b", true);
@@ -2412,10 +2398,10 @@ mod tests {
                     inner_list_builder.finish();
                 }
 
-                let _ = inner_object_builder.finish();
+                inner_object_builder.finish();
             }
 
-            let _ = outer_object_builder.finish();
+            outer_object_builder.finish();
         }
 
         let (metadata, value) = builder.finish();
@@ -2515,7 +2501,7 @@ mod tests {
                     let mut inner_object_builder = inner_list_builder.new_object();
                     inner_object_builder.insert("a", "b");
                     inner_object_builder.insert("b", "c");
-                    let _ = inner_object_builder.finish();
+                    inner_object_builder.finish();
                 }
 
                 {
@@ -2524,7 +2510,7 @@ mod tests {
                     let mut inner_object_builder = inner_list_builder.new_object();
                     inner_object_builder.insert("c", "d");
                     inner_object_builder.insert("d", "e");
-                    let _ = inner_object_builder.finish();
+                    inner_object_builder.finish();
                 }
 
                 inner_list_builder.finish();
@@ -2610,7 +2596,7 @@ mod tests {
         let mut obj = builder.new_object();
         obj.insert("a", 1);
         obj.insert("a", 2);
-        assert!(obj.finish().is_ok());
+        obj.finish();
 
         // Deeply nested list structure with duplicates
         let mut builder = VariantBuilder::new();
@@ -2620,12 +2606,8 @@ mod tests {
         nested_obj.insert("x", 1);
         nested_obj.insert("x", 2);
         nested_obj.new_list("x").with_value(3).finish();
-        nested_obj
-            .new_object("x")
-            .with_field("y", 4)
-            .finish()
-            .unwrap();
-        assert!(nested_obj.finish().is_ok());
+        nested_obj.new_object("x").with_field("y", 4).finish();
+        nested_obj.finish();
         inner_list.finish();
         outer_list.finish();
 
@@ -2685,8 +2667,8 @@ mod tests {
         valid_obj.insert("m", 1);
         valid_obj.insert("n", 2);
 
-        let valid_result = valid_obj.finish();
-        assert!(valid_result.is_ok());
+        valid_obj.finish();
+        list.finish();
     }
 
     #[test]
@@ -2755,7 +2737,7 @@ mod tests {
 
         // add a field name that wasn't pre-defined but doesn't break the sort order
         obj.insert("d", 2);
-        obj.finish().unwrap();
+        obj.finish();
 
         let (metadata, value) = variant1.finish();
         let variant = Variant::try_new(&metadata, &value).unwrap();
@@ -2789,7 +2771,7 @@ mod tests {
 
         // add a field name that wasn't pre-defined but breaks the sort order
         obj.insert("a", 2);
-        obj.finish().unwrap();
+        obj.finish();
 
         let (metadata, value) = variant1.finish();
         let variant = Variant::try_new(&metadata, &value).unwrap();
@@ -3033,7 +3015,7 @@ mod tests {
         // Create a nested object builder and finish it
         let mut nested_object_builder = list_builder.new_object();
         nested_object_builder.insert("name", "unknown");
-        nested_object_builder.finish().unwrap();
+        nested_object_builder.finish();
 
         // Drop the outer list builder without finishing it
         drop(list_builder);
@@ -3063,7 +3045,7 @@ mod tests {
         object_builder.insert("second", 2i8);
 
         // The parent object should only contain the original fields
-        object_builder.finish().unwrap();
+        object_builder.finish();
         let (metadata, value) = builder.finish();
 
         let metadata = VariantMetadata::try_new(&metadata).unwrap();
@@ -3117,7 +3099,7 @@ mod tests {
         object_builder.insert("second", 2i8);
 
         // The parent object should only contain the original fields
-        object_builder.finish().unwrap();
+        object_builder.finish();
         let (metadata, value) = builder.finish();
 
         let metadata = VariantMetadata::try_new(&metadata).unwrap();
@@ -3141,7 +3123,7 @@ mod tests {
         // Create a nested object builder and finish it
         let mut nested_object_builder = object_builder.new_object("nested");
         nested_object_builder.insert("name", "unknown");
-        nested_object_builder.finish().unwrap();
+        nested_object_builder.finish();
 
         // Drop the outer object builder without finishing it
         drop(object_builder);
@@ -3179,7 +3161,7 @@ mod tests {
 
         obj.insert("b", true);
         obj.insert("a", false);
-        obj.finish().unwrap();
+        obj.finish();
         builder.finish()
     }
 
@@ -3208,10 +3190,10 @@ mod tests {
             {
                 let mut inner_obj = outer_obj.new_object("b");
                 inner_obj.insert("a", "inner_value");
-                inner_obj.finish().unwrap();
+                inner_obj.finish();
             }
 
-            outer_obj.finish().unwrap();
+            outer_obj.finish();
         }
 
         builder.finish()
@@ -3289,7 +3271,7 @@ mod tests {
                             }
                         }
                         if i % skip != 0 {
-                            object.finish().unwrap();
+                            object.finish();
                         }
                     }
                     if i % skip != 0 {
@@ -3297,7 +3279,7 @@ mod tests {
                     }
                 }
                 if i % skip != 0 {
-                    object.finish().unwrap();
+                    object.finish();
                 }
             }
             list.finish();
@@ -3333,7 +3315,7 @@ mod tests {
             obj.insert("name", "Alice");
             obj.insert("age", 30i8);
             obj.insert("active", true);
-            obj.finish().unwrap();
+            obj.finish();
         }
 
         let value = value_builder.into_inner();
@@ -3394,9 +3376,9 @@ mod tests {
                 let mut address = obj.new_object("address");
                 address.insert("street", "123 Main St");
                 address.insert("city", "Anytown");
-                address.finish().unwrap();
+                address.finish();
             }
-            obj.finish().unwrap();
+            obj.finish();
         }
         let (metadata, value1) = builder.finish();
         let variant1 = Variant::try_new(&metadata, &value1).unwrap();
@@ -3423,7 +3405,7 @@ mod tests {
             obj.insert("field2", 42i32);
             obj.insert("field3", true);
             obj.insert("field4", "value4");
-            obj.finish().unwrap();
+            obj.finish();
         }
         let (metadata1, value1) = builder.finish();
         let original_variant = Variant::try_new(&metadata1, &value1).unwrap();
@@ -3452,7 +3434,7 @@ mod tests {
             // Copy field2 using bytes API
             obj.insert_bytes("field2", original_obj.get("field2").unwrap());
 
-            obj.finish().unwrap();
+            obj.finish();
         }
         let value2 = builder2.into_inner();
         let result_variant = Variant::try_new(&metadata1, &value2).unwrap();
@@ -3556,7 +3538,7 @@ mod tests {
                     user1.insert("id", 1i32);
                     user1.insert("name", "Alice");
                     user1.insert("active", true);
-                    user1.finish().unwrap();
+                    user1.finish();
                 }
 
                 // User 2
@@ -3565,7 +3547,7 @@ mod tests {
                     user2.insert("id", 2i32);
                     user2.insert("name", "Bob");
                     user2.insert("active", false);
-                    user2.finish().unwrap();
+                    user2.finish();
                 }
 
                 // User 3
@@ -3574,14 +3556,14 @@ mod tests {
                     user3.insert("id", 3i32);
                     user3.insert("name", "Charlie");
                     user3.insert("active", true);
-                    user3.finish().unwrap();
+                    user3.finish();
                 }
 
                 users_list.finish();
             }
 
             root_obj.insert("total_count", 3i32);
-            root_obj.finish().unwrap();
+            root_obj.finish();
         }
         let (metadata1, value1) = builder.finish();
         let original_variant = Variant::try_new(&metadata1, &value1).unwrap();
@@ -3625,7 +3607,7 @@ mod tests {
                             // Add status transformation (don't copy the 'active' field)
                             new_user.insert("status", "verified");
 
-                            new_user.finish().unwrap();
+                            new_user.finish();
                         }
                     }
                 }
@@ -3637,7 +3619,7 @@ mod tests {
                     new_user.insert("name", "System User");
                     new_user.insert("computed_score", 0i32);
                     new_user.insert("status", "system");
-                    new_user.finish().unwrap();
+                    new_user.finish();
                 }
 
                 filtered_users.finish();
@@ -3646,7 +3628,7 @@ mod tests {
             // Update count
             root_obj.insert("active_count", 3i32); // 2 active + 1 new
 
-            root_obj.finish().unwrap();
+            root_obj.finish();
         }
         let value2 = builder2.into_inner();
         let result_variant = Variant::try_new(&metadata1, &value2).unwrap();
diff --git a/parquet-variant/src/variant.rs b/parquet-variant/src/variant.rs
index 003d46c122a4..64458c669eed 100644
--- a/parquet-variant/src/variant.rs
+++ b/parquet-variant/src/variant.rs
@@ -1149,7 +1149,7 @@ impl<'m, 'v> Variant<'m, 'v> {
     /// # list.append_value("bar");
     /// # list.append_value("baz");
     /// # list.finish();
-    /// # obj.finish().unwrap();
+    /// # obj.finish();
     /// # let (metadata, value) = builder.finish();
     /// // given a variant like `{"foo": ["bar", "baz"]}`
     /// let variant = Variant::new(&metadata, &value);
@@ -1578,7 +1578,7 @@ mod tests {
         let mut nested_obj = root_obj.new_object("nested_object");
         nested_obj.insert("inner_key1", "inner_value1");
         nested_obj.insert("inner_key2", 999i32);
-        nested_obj.finish().unwrap();
+        nested_obj.finish();
 
         // Add list with mixed types
         let mut mixed_list = root_obj.new_list("mixed_list");
@@ -1596,7 +1596,7 @@ mod tests {
 
         mixed_list.finish();
 
-        root_obj.finish().unwrap();
+        root_obj.finish();
 
         let (metadata, value) = builder.finish();
         let variant = Variant::try_new(&metadata, &value).unwrap();
diff --git a/parquet-variant/src/variant/list.rs b/parquet-variant/src/variant/list.rs
index e3053ce9100e..438faddffe15 100644
--- a/parquet-variant/src/variant/list.rs
+++ b/parquet-variant/src/variant/list.rs
@@ -697,7 +697,7 @@ mod tests {
             // list3 (10..20)
             let (metadata3, value3) = make_listi32(10i32..20i32);
             object_builder.insert("list3", Variant::new(&metadata3, &value3));
-            object_builder.finish().unwrap();
+            object_builder.finish();
             builder.finish()
         };
 
diff --git a/parquet-variant/src/variant/metadata.rs b/parquet-variant/src/variant/metadata.rs
index 7b2292aae279..1c9da6bcc0cf 100644
--- a/parquet-variant/src/variant/metadata.rs
+++ b/parquet-variant/src/variant/metadata.rs
@@ -573,7 +573,7 @@ mod tests {
         o.insert("a", false);
         o.insert("b", false);
 
-        o.finish().unwrap();
+        o.finish();
 
         let (m, _) = b.finish();
 
@@ -608,7 +608,7 @@ mod tests {
         o.insert("a", false);
         o.insert("b", false);
 
-        o.finish().unwrap();
+        o.finish();
 
         let (m, _) = b.finish();
 
diff --git a/parquet-variant/src/variant/object.rs b/parquet-variant/src/variant/object.rs
index 2d58c897c118..df1857846302 100644
--- a/parquet-variant/src/variant/object.rs
+++ b/parquet-variant/src/variant/object.rs
@@ -550,7 +550,7 @@ mod tests {
     #[test]
     fn test_variant_object_empty_fields() {
         let mut builder = VariantBuilder::new();
-        builder.new_object().with_field("", 42).finish().unwrap();
+        builder.new_object().with_field("", 42).finish();
         let (metadata, value) = builder.finish();
 
         // Resulting object is valid and has a single empty field
@@ -676,7 +676,7 @@ mod tests {
             obj.insert(&field_names[i as usize], i);
         }
 
-        obj.finish().unwrap();
+        obj.finish();
         let (metadata, value) = builder.finish();
         let variant = Variant::new(&metadata, &value);
 
@@ -737,7 +737,7 @@ mod tests {
             obj.insert(&key, str_val.as_str());
         }
 
-        obj.finish().unwrap();
+        obj.finish();
         let (metadata, value) = builder.finish();
         let variant = Variant::new(&metadata, &value);
 
@@ -783,7 +783,7 @@ mod tests {
         o.insert("c", ());
         o.insert("a", ());
 
-        o.finish().unwrap();
+        o.finish();
 
         let (m, v) = b.finish();
 
@@ -801,7 +801,7 @@ mod tests {
         o.insert("a", ());
         o.insert("b", false);
 
-        o.finish().unwrap();
+        o.finish();
         let (m, v) = b.finish();
 
         let v1 = Variant::try_new(&m, &v).unwrap();
@@ -812,7 +812,7 @@ mod tests {
         o.insert("a", ());
         o.insert("b", false);
 
-        o.finish().unwrap();
+        o.finish();
         let (m, v) = b.finish();
 
         let v2 = Variant::try_new(&m, &v).unwrap();
@@ -828,7 +828,7 @@ mod tests {
         o.insert("a", ());
         o.insert("b", 4.3);
 
-        o.finish().unwrap();
+        o.finish();
 
         let (m, v) = b.finish();
 
@@ -841,8 +841,8 @@ mod tests {
         o.insert("a", ());
         let mut inner_o = o.new_object("b");
         inner_o.insert("a", 3.3);
-        inner_o.finish().unwrap();
-        o.finish().unwrap();
+        inner_o.finish();
+        o.finish();
 
         let (m, v) = b.finish();
 
@@ -866,7 +866,7 @@ mod tests {
         o.insert("a", ());
         o.insert("b", 4.3);
 
-        o.finish().unwrap();
+        o.finish();
 
         let (m, v) = b.finish();
 
@@ -879,7 +879,7 @@ mod tests {
         o.insert("aardvark", ());
         o.insert("barracuda", 3.3);
 
-        o.finish().unwrap();
+        o.finish();
 
         let (m, v) = b.finish();
         let v2 = Variant::try_new(&m, &v).unwrap();
@@ -895,7 +895,7 @@ mod tests {
         o.insert("b", false);
         o.insert("a", ());
 
-        o.finish().unwrap();
+        o.finish();
 
         let (m, v) = b.finish();
 
@@ -910,7 +910,7 @@ mod tests {
         o.insert("a", ());
         o.insert("b", false);
 
-        o.finish().unwrap();
+        o.finish();
 
         let (m, v) = b.finish();
 
@@ -930,7 +930,7 @@ mod tests {
         o.insert("a", ());
         o.insert("b", 4.3);
 
-        o.finish().unwrap();
+        o.finish();
 
         let (meta1, value1) = b.finish();
 
@@ -945,7 +945,7 @@ mod tests {
         o.insert("b", 4.3);
         o.insert("a", ());
 
-        o.finish().unwrap();
+        o.finish();
 
         let (meta2, value2) = b.finish();
 
@@ -969,7 +969,7 @@ mod tests {
         o.insert("a", false);
         o.insert("b", false);
 
-        o.finish().unwrap();
+        o.finish();
 
         let (m, v) = b.finish();
 


Test patch:
diff --git a/parquet-variant/tests/variant_interop.rs b/parquet-variant/tests/variant_interop.rs
index 07ff6d01b410..00c326c06406 100644
--- a/parquet-variant/tests/variant_interop.rs
+++ b/parquet-variant/tests/variant_interop.rs
@@ -272,7 +272,7 @@ fn variant_object_builder() {
     obj.insert("null_field", ());
     obj.insert("timestamp_field", "2025-04-16T12:34:56.78");
 
-    obj.finish().unwrap();
+    obj.finish();
 
     let (built_metadata, built_value) = builder.finish();
     let actual = Variant::try_new(&built_metadata, &built_value).unwrap();
@@ -384,7 +384,7 @@ fn generate_random_value(rng: &mut StdRng, builder: &mut VariantBuilder, max_dep
                 let key = format!("field_{i}");
                 object_builder.insert(&key, rng.random::<i32>());
             }
-            object_builder.finish().unwrap();
+            object_builder.finish();
         }
         15 => {
             // Time