zeroshade commented on code in PR #1411:
URL: https://github.com/apache/iceberg-go/pull/1411#discussion_r3553633902


##########
catalog/sql/sql.go:
##########
@@ -672,13 +677,30 @@ func (c *Catalog) LoadNamespaceProperties(ctx 
context.Context, namespace table.I
 
                result := make(iceberg.Properties)
                for _, p := range props {
+                       if isReservedNamespaceProperty(p.PropertyKey) {
+                               continue
+                       }
                        result[p.PropertyKey] = p.PropertyValue.String
                }
 
                return result, nil
        })
 }
 
+func validateNamespacePropertyUpdates(removals []string, updates 
iceberg.Properties) error {
+       if _, ok := updates[namespaceExistsProperty]; ok {
+               return fmt.Errorf("%w: cannot update reserved namespace 
property %q", iceberg.ErrInvalidArgument, namespaceExistsProperty)
+       }
+
+       for _, key := range removals {
+               if isReservedNamespaceProperty(key) {
+                       return fmt.Errorf("%w: cannot remove reserved namespace 
property %q", iceberg.ErrInvalidArgument, namespaceExistsProperty)

Review Comment:
   This formats the constant `namespaceExistsProperty` (always `exists`) 
instead of the loop variable `key`. They're identical today because 
`isReservedNamespaceProperty` only matches `exists`, but once the reserved set 
grows this will report the wrong property name for any reserved-key removal. 
Use `key` here.



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