tanmayrauth commented on code in PR #1413:
URL: https://github.com/apache/iceberg-go/pull/1413#discussion_r3525962604


##########
partitions.go:
##########
@@ -210,6 +210,9 @@ func NewPartitionSpecOpts(opts ...PartitionOption) 
(PartitionSpec, error) {
 
 func WithSpecID(id int) PartitionOption {
        return func(p *PartitionSpec) error {
+               if id < 0 {
+                       return fmt.Errorf("%w: spec id must be non-negative: 
%d", ErrInvalidPartitionSpec, id)

Review Comment:
   `return fmt.Errorf("%w: spec id must be non-negative: %d", 
ErrInvalidPartitionSpec, id)` — this double-wraps the sentinel. 
NewPartitionSpecOpts already wraps every option error with `%w: 
ErrInvalidPartitionSpec` (line 203), so the message comes out as "invalid 
partition spec: invalid partition spec: spec id must be non-negative: -1". The 
sibling options (AddPartitionFieldByName, addSpecFieldInternal, etc.) all 
return bare errors for exactly this reason.  



-- 
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