This is an automated email from the ASF dual-hosted git repository.

blackmwk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-rust.git


The following commit(s) were added to refs/heads/main by this push:
     new 5eb342ff1 fix(tests): remove unnecessary `.to_string()` calls for 
metadata_location (#2407)
5eb342ff1 is described below

commit 5eb342ff1618171c52db0f1727372bf1f9589e27
Author: Liang Gong <[email protected]>
AuthorDate: Thu May 7 19:14:22 2026 +0800

    fix(tests): remove unnecessary `.to_string()` calls for metadata_location 
(#2407)
    
    ## Which issue does this PR close?
    
    <!--
    We generally require a GitHub issue to be filed for all bug fixes and
    enhancements and this helps us generate change logs for our releases.
    You can link an issue to this PR using the GitHub syntax. For example
    `Closes #123` indicates that this PR will close issue #123.
    -->
    
    No related issue. Just some simple fixes for unnecessary `.to_string()`
    calls.
    
    ## What changes are included in this PR?
    
    <!--
    Provide a summary of the modifications in this PR. List the main changes
    such as new features, bug fixes, refactoring, or any other updates.
    -->
    
    Remove some redundant `to_string()` calls in `mod tests` for method
    `metadata_location`.
    
    ## Are these changes tested?
    
    <!--
    Specify what test covers (unit test, integration test, etc.).
    
    If tests are not included in your PR, please explain why (for example,
    are they covered by existing tests)?
    -->
    
    Sure.
---
 crates/iceberg/src/catalog/mod.rs                        |  2 +-
 crates/iceberg/src/spec/table_metadata_builder.rs        |  4 ++--
 crates/iceberg/src/transaction/mod.rs                    |  6 +++---
 .../integrations/datafusion/src/physical_plan/project.rs |  6 +++---
 .../datafusion/src/physical_plan/repartition.rs          | 16 ++++++++--------
 5 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/crates/iceberg/src/catalog/mod.rs 
b/crates/iceberg/src/catalog/mod.rs
index 43102adec..51daa5059 100644
--- a/crates/iceberg/src/catalog/mod.rs
+++ b/crates/iceberg/src/catalog/mod.rs
@@ -2390,7 +2390,7 @@ mod tests {
 
             Table::builder()
                 .metadata(resp)
-                
.metadata_location("s3://bucket/test/location/metadata/00000-8a62c37d-4573-4021-952a-c0baef7d21d0.metadata.json".to_string())
+                
.metadata_location("s3://bucket/test/location/metadata/00000-8a62c37d-4573-4021-952a-c0baef7d21d0.metadata.json")
                 .identifier(TableIdent::from_strs(["ns1", "test1"]).unwrap())
                 .file_io(FileIO::new_with_memory())
                 .build()
diff --git a/crates/iceberg/src/spec/table_metadata_builder.rs 
b/crates/iceberg/src/spec/table_metadata_builder.rs
index 65dbae1bf..5754b5fe0 100644
--- a/crates/iceberg/src/spec/table_metadata_builder.rs
+++ b/crates/iceberg/src/spec/table_metadata_builder.rs
@@ -2709,7 +2709,7 @@ mod tests {
 
         let table = Table::builder()
             .metadata(resp)
-            
.metadata_location("s3://bucket/test/location/metadata/v1.json".to_string())
+            .metadata_location("s3://bucket/test/location/metadata/v1.json")
             .identifier(TableIdent::from_strs(["ns1", "test1"]).unwrap())
             .file_io(FileIO::new_with_memory())
             .build()
@@ -2740,7 +2740,7 @@ mod tests {
 
         let table = Table::builder()
             .metadata(resp)
-            
.metadata_location("s3://bucket/test/location/metadata/v1.json".to_string())
+            .metadata_location("s3://bucket/test/location/metadata/v1.json")
             .identifier(TableIdent::from_strs(["ns1", "test1"]).unwrap())
             .file_io(FileIO::new_with_memory())
             .build()
diff --git a/crates/iceberg/src/transaction/mod.rs 
b/crates/iceberg/src/transaction/mod.rs
index cb2ff7cf3..ff74e902d 100644
--- a/crates/iceberg/src/transaction/mod.rs
+++ b/crates/iceberg/src/transaction/mod.rs
@@ -254,7 +254,7 @@ mod tests {
 
         Table::builder()
             .metadata(resp)
-            
.metadata_location("s3://bucket/test/location/metadata/v1.json".to_string())
+            .metadata_location("s3://bucket/test/location/metadata/v1.json")
             .identifier(TableIdent::from_strs(["ns1", "test1"]).unwrap())
             .file_io(FileIO::new_with_memory())
             .build()
@@ -273,7 +273,7 @@ mod tests {
 
         Table::builder()
             .metadata(resp)
-            
.metadata_location("s3://bucket/test/location/metadata/v1.json".to_string())
+            .metadata_location("s3://bucket/test/location/metadata/v1.json")
             .identifier(TableIdent::from_strs(["ns1", "test1"]).unwrap())
             .file_io(FileIO::new_with_memory())
             .build()
@@ -292,7 +292,7 @@ mod tests {
 
         Table::builder()
             .metadata(resp)
-            
.metadata_location("s3://bucket/test/location/metadata/v1.json".to_string())
+            .metadata_location("s3://bucket/test/location/metadata/v1.json")
             .identifier(TableIdent::from_strs(["ns1", "test1"]).unwrap())
             .file_io(FileIO::new_with_memory())
             .build()
diff --git a/crates/integrations/datafusion/src/physical_plan/project.rs 
b/crates/integrations/datafusion/src/physical_plan/project.rs
index f31bb29dd..0320d52dd 100644
--- a/crates/integrations/datafusion/src/physical_plan/project.rs
+++ b/crates/integrations/datafusion/src/physical_plan/project.rs
@@ -447,7 +447,7 @@ mod tests {
             .metadata(table_metadata.metadata)
             .identifier(TableIdent::from_strs(["test", "table"]).unwrap())
             .file_io(FileIO::new_with_fs())
-            .metadata_location("/test/metadata.json".to_string())
+            .metadata_location("/test/metadata.json")
             .build()
             .unwrap();
 
@@ -505,7 +505,7 @@ mod tests {
             .metadata(table_metadata.metadata)
             .identifier(TableIdent::from_strs(["test", "table"]).unwrap())
             .file_io(FileIO::new_with_fs())
-            .metadata_location("/test/metadata.json".to_string())
+            .metadata_location("/test/metadata.json")
             .build()
             .unwrap();
 
@@ -577,7 +577,7 @@ mod tests {
             .metadata(table_metadata.metadata)
             .identifier(TableIdent::from_strs(["test", "table"]).unwrap())
             .file_io(FileIO::new_with_fs())
-            .metadata_location("/test/metadata.json".to_string())
+            .metadata_location("/test/metadata.json")
             .build()
             .unwrap();
 
diff --git a/crates/integrations/datafusion/src/physical_plan/repartition.rs 
b/crates/integrations/datafusion/src/physical_plan/repartition.rs
index 78063c730..00552ce9a 100644
--- a/crates/integrations/datafusion/src/physical_plan/repartition.rs
+++ b/crates/integrations/datafusion/src/physical_plan/repartition.rs
@@ -222,7 +222,7 @@ mod tests {
             .metadata(table_metadata.metadata)
             .identifier(TableIdent::from_strs(["test", "table"]).unwrap())
             .file_io(FileIO::new_with_fs())
-            .metadata_location("/test/metadata.json".to_string())
+            .metadata_location("/test/metadata.json")
             .build()
             .unwrap()
     }
@@ -379,7 +379,7 @@ mod tests {
             .metadata(table_metadata.metadata)
             .identifier(TableIdent::from_strs(["test", 
"bucketed_table"]).unwrap())
             .file_io(FileIO::new_with_fs())
-            .metadata_location("/test/bucketed_metadata.json".to_string())
+            .metadata_location("/test/bucketed_metadata.json")
             .build()
             .unwrap();
 
@@ -464,7 +464,7 @@ mod tests {
             .metadata(table_metadata.metadata)
             .identifier(TableIdent::from_strs(["test", 
"partitioned_bucketed_table"]).unwrap())
             .file_io(FileIO::new_with_fs())
-            
.metadata_location("/test/partitioned_bucketed_metadata.json".to_string())
+            .metadata_location("/test/partitioned_bucketed_metadata.json")
             .build()
             .unwrap();
 
@@ -548,7 +548,7 @@ mod tests {
             .metadata(table_metadata.metadata)
             .identifier(TableIdent::from_strs(["test", "none_table"]).unwrap())
             .file_io(FileIO::new_with_fs())
-            .metadata_location("/test/none_metadata.json".to_string())
+            .metadata_location("/test/none_metadata.json")
             .build()
             .unwrap();
 
@@ -620,7 +620,7 @@ mod tests {
             .metadata(table_metadata.metadata)
             .identifier(TableIdent::from_strs(["test", 
"range_only_table"]).unwrap())
             .file_io(FileIO::new_with_fs())
-            .metadata_location("/test/range_only_metadata.json".to_string())
+            .metadata_location("/test/range_only_metadata.json")
             .build()
             .unwrap();
 
@@ -695,7 +695,7 @@ mod tests {
             .metadata(table_metadata.metadata)
             .identifier(TableIdent::from_strs(["test", 
"mixed_transforms_table"]).unwrap())
             .file_io(FileIO::new_with_fs())
-            
.metadata_location("/test/mixed_transforms_metadata.json".to_string())
+            .metadata_location("/test/mixed_transforms_metadata.json")
             .build()
             .unwrap();
 
@@ -778,7 +778,7 @@ mod tests {
             .metadata(table_metadata.metadata)
             .identifier(TableIdent::from_strs(["test", 
"temporal_partition"]).unwrap())
             .file_io(FileIO::new_with_fs())
-            .metadata_location("/test/temporal_metadata.json".to_string())
+            .metadata_location("/test/temporal_metadata.json")
             .build()
             .unwrap();
 
@@ -851,7 +851,7 @@ mod tests {
             .metadata(table_metadata.metadata)
             .identifier(TableIdent::from_strs(["test", 
"identity_partition"]).unwrap())
             .file_io(FileIO::new_with_fs())
-            .metadata_location("/test/identity_metadata.json".to_string())
+            .metadata_location("/test/identity_metadata.json")
             .build()
             .unwrap();
 

Reply via email to