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

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


The following commit(s) were added to refs/heads/main by this push:
     new 1114e389 fix(table): error formatting (#747)
1114e389 is described below

commit 1114e389caa198d86271a78e7260125e504cf186
Author: ferhat elmas <[email protected]>
AuthorDate: Fri Feb 20 18:50:40 2026 +0100

    fix(table): error formatting (#747)
    
    related to #723
    
    Signed-off-by: ferhat elmas <[email protected]>
---
 table/transaction.go | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/table/transaction.go b/table/transaction.go
index 00fe7354..765d9149 100644
--- a/table/transaction.go
+++ b/table/transaction.go
@@ -439,9 +439,6 @@ func (t *Transaction) ReplaceDataFiles(ctx context.Context, 
filesToDelete, files
 // the current partition spec fields by ID without reading file contents.
 func validateDataFilePartitionData(df iceberg.DataFile, spec 
*iceberg.PartitionSpec) error {
        partitionData := df.Partition()
-       if partitionData == nil {
-               partitionData = map[int]any{}
-       }
 
        expectedFieldIDs := make(map[int]string)
        for field := range spec.Fields() {
@@ -464,9 +461,12 @@ func validateDataFilePartitionData(df iceberg.DataFile, 
spec *iceberg.PartitionS
 // DataFiles and returns a set of paths that passed validation.
 func (t *Transaction) validateDataFilesToAdd(dataFiles []iceberg.DataFile, 
operation string) (map[string]struct{}, error) {
        currentSpec, err := t.meta.CurrentSpec()
-       if err != nil || currentSpec == nil {
+       if err != nil {
                return nil, fmt.Errorf("could not get current partition spec: 
%w", err)
        }
+       if currentSpec == nil {
+               return nil, errors.New("could not get current partition spec: 
no current partition spec found")
+       }
 
        expectedSpecID := int32(currentSpec.ID())
        setToAdd := make(map[string]struct{}, len(dataFiles))
@@ -546,7 +546,7 @@ func (t *Transaction) AddDataFiles(ctx context.Context, 
dataFiles []iceberg.Data
                }
 
                if len(referenced) > 0 {
-                       return fmt.Errorf("cannot add files that are already 
referenced by table, files: %s", referenced)
+                       return fmt.Errorf("cannot add files that are already 
referenced by table, files: %v", referenced)
                }
        }
 
@@ -710,7 +710,7 @@ func (t *Transaction) AddFiles(ctx context.Context, files 
[]string, snapshotProp
                                }
                        }
                        if len(referenced) > 0 {
-                               return fmt.Errorf("cannot add files that are 
already referenced by table, files: %s", referenced)
+                               return fmt.Errorf("cannot add files that are 
already referenced by table, files: %v", referenced)
                        }
                }
        }

Reply via email to