alamb commented on code in PR #7843:
URL: https://github.com/apache/arrow-rs/pull/7843#discussion_r2178410898


##########
parquet-variant/src/builder.rs:
##########
@@ -752,10 +784,20 @@ impl<'a, 'b> ObjectBuilder<'a, 'b> {
 
         self.parent_buffer.append_slice(self.buffer.inner());
 
+        self.finished = true;
+
         Ok(())
     }
 }
 
+impl Drop for ObjectBuilder<'_, '_> {
+    fn drop(&mut self) {
+        if !self.finished {
+            self._finish().expect("Failed to finalize ObjectBuilder");

Review Comment:
   I think this can now panic if a user sets the `validate` flag on these 
builders.



##########
parquet-variant/src/builder.rs:
##########
@@ -1452,6 +1510,9 @@ mod tests {
             "Invalid argument error: Duplicate field keys detected: [x]"
         );
 
+        inner_list.finish();
+        outer_list.finish();
+

Review Comment:
   awesome



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