ZENOTME commented on code in PR #760:
URL: https://github.com/apache/iceberg-rust/pull/760#discussion_r1877298111


##########
crates/iceberg/src/writer/mod.rs:
##########
@@ -99,12 +201,12 @@ mod tests {
     use arrow_select::concat::concat_batches;
     use parquet::arrow::arrow_reader::ParquetRecordBatchReaderBuilder;
 
-    use super::IcebergWriter;
+    use super::{BoxedIcebergWriter, IcebergWriter};
     use crate::io::FileIO;
     use crate::spec::{DataFile, DataFileFormat};
 
     // This function is used to guarantee the trait can be used as a object 
safe trait.
-    async fn _guarantee_object_safe(mut w: Box<dyn IcebergWriter>) {
+    async fn _guarantee_object_safe(mut w: BoxedIcebergWriter) {

Review Comment:
   We can add some case in this function to make sure type works in compile 
time and as the example of how can we use them🤔, like 
   ```
    async fn _guarantee_object_safe(
           w: impl IcebergWriter,
           w_b: impl IcebergWriterBuilder,
           mut box_w: BoxedIcebergWriter,
           box_w_b: BoxedIcebergWriterBuilder,
       ) {
           let _ = box_w
               .write(RecordBatch::new_empty(Schema::empty().into()))
               .await;
           let _ = box_w.close().await;
           let _box_w = box_w_b.build().await.unwrap();
   
           let box_w_b = w_b.clone().boxed();
           let _box_w = box_w_b.build().await.unwrap();
           let _box_w = w.boxed();
           let _box_w = w_b.build().await.unwrap().boxed();
       }
   ```



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to