alliasgher opened a new pull request, #888:
URL: https://github.com/apache/iceberg-go/pull/888

   ## Summary
   
   Follow-up to the review comment on 
[#875](https://github.com/apache/iceberg-go/pull/875#discussion_r3074078181) — 
`DataFileStatistics.ToDataFile` grew to eight positional arguments including 
two adjacent `int`s (`filesize` and `sortOrderID`), which is hard to read at 
call sites and easy to swap by mistake.
   
   This PR collapses the parameters into a `DataFileOpts` struct:
   
   ```go
   type DataFileOpts struct {
       Schema          *iceberg.Schema
       Spec            iceberg.PartitionSpec
       Path            string
       Format          iceberg.FileFormat
       Content         iceberg.ManifestEntryContent
       FileSize        int64
       PartitionValues map[int]any
       SortOrderID     int
   }
   
   func (d *DataFileStatistics) ToDataFile(opts DataFileOpts) iceberg.DataFile
   ```
   
   All six call sites (two production, four tests) are updated to the 
named-field form. Future additions are source-compatible.
   
   ## Notes
   
   - Stacked on #875 — this PR will show both diffs until #875 merges, at which 
point only the refactor remains.
   - No behaviour change.
   
   ## Test plan
   
   - [x] `go test ./...`
   - [x] `gofmt` clean
   
   Signed-off-by: Ali <[email protected]>


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to