Skip to content

Commit

Permalink
sort partitionSummary to prevent spurious test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroshade committed Mar 3, 2025
1 parent 83cbc41 commit 2bc0451
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion table/snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ func (s *SnapshotSummaryCollector) removeFile(df iceberg.DataFile, sc *iceberg.S

func (s *SnapshotSummaryCollector) partitionSummary(metrics *updateMetrics) string {
props := metrics.toProps()
return strings.Join(slices.Collect(func(yield func(s string) bool) {
return strings.Join(slices.Sorted(func(yield func(s string) bool) {
for k, v := range props {
if !yield(fmt.Sprintf("%s=%s", k, v)) {
return
Expand Down
4 changes: 2 additions & 2 deletions table/snapshots_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ func TestSnapshotSummaryCollectorWithPartition(t *testing.T) {
"added-records": "100",
"deleted-records": "300",
"changed-partition-count": "2",
"partitions.int_field=1": "added-files-size=1234,removed-files-size=1234,added-data-files=1,deleted-data-files=1,added-records=100,deleted-records=100",
"partitions.int_field=2": "removed-files-size=4321,deleted-data-files=1,deleted-records=200",
"partitions.int_field=1": "added-data-files=1,added-files-size=1234,added-records=100,deleted-data-files=1,deleted-records=100,removed-files-size=1234",
"partitions.int_field=2": "deleted-data-files=1,deleted-records=200,removed-files-size=4321",
}, ssc.build())
}

Expand Down

0 comments on commit 2bc0451

Please sign in to comment.