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

sdd 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 7bf0884e chore: minor update to manifest sanity check error message 
(#1278)
7bf0884e is described below

commit 7bf0884e5876ecfbdeade8f54aacb60694aeb8bd
Author: dentiny <[email protected]>
AuthorDate: Mon May 12 15:18:21 2025 -0700

    chore: minor update to manifest sanity check error message (#1278)
    
    ## What changes are included in this PR?
    
    This is the error message I get on my end:
    ```sh
    Error: DataInvalid => Content type of entry PositionDeletes should have 
DataContentType::Data
    ```
    At first sight, I have no idea what this means, until I read the sanity
    check code.
    
    In this PR, I updated the error message for manifest write sanity check
    to provide more context:
    - What's the manifest content file
    - What's the filepath, this is useful for devs to directly understand
    what's the data file having issues
    - What's the expected and actual data content type
    
    ## Are these changes tested?
    
    No-op change
    
    Co-authored-by: Scott Donnelly <[email protected]>
---
 crates/iceberg/src/spec/manifest/writer.rs | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/crates/iceberg/src/spec/manifest/writer.rs 
b/crates/iceberg/src/spec/manifest/writer.rs
index 35d9acb6..8f08803d 100644
--- a/crates/iceberg/src/spec/manifest/writer.rs
+++ b/crates/iceberg/src/spec/manifest/writer.rs
@@ -171,7 +171,8 @@ impl ManifestWriter {
                     return Err(Error::new(
                         ErrorKind::DataInvalid,
                         format!(
-                            "Content type of entry {:?} should have 
DataContentType::Data",
+                            "Date file at path {} with manifest content type 
`data`, should have DataContentType `Data`, but has `{:?}`",
+                            data_file.file_path(),
                             data_file.content
                         ),
                     ));
@@ -183,7 +184,11 @@ impl ManifestWriter {
                 {
                     return Err(Error::new(
                     ErrorKind::DataInvalid,
-                    format!("Content type of entry {:?} should have 
DataContentType::EqualityDeletes or DataContentType::PositionDeletes", 
data_file.content),
+                    format!(
+                        "Date file at path {} with manifest content type 
`deletes`, should have DataContentType `Data`, but has `{:?}`",
+                        data_file.file_path(),
+                        data_file.content
+                    ),
                 ));
                 }
             }

Reply via email to