jamesbornholt opened a new pull request, #3212:
URL: https://github.com/apache/iceberg-python/pull/3212

   ## Rationale for this change
   
   The IRC spec's GetNamespaceResponse schema [only requires the 'namespace' 
field](https://github.com/apache/iceberg/blob/23b5e1d295e0a89d8aeeb49483c2f863fcd9142b/open-api/rest-catalog-open-api.yaml#L4146-L4163);
 namespace property support is optional and the 'properties' field is nullable. 
The pyiceberg NamespaceResponse model declared properties as required with no 
default, causing pydantic validation failures when servers omit the field or 
set it to null.
   
   Add default_factory=dict so that an omitted field defaults to an empty dict, 
and a field_validator to coerce null to an empty dict. Add tests for both cases.
   
   For comparison, in the Java code, Jackson leaves `properties` as `null` when 
absent or explicitly null, and then the [getter returns an empty 
map](https://github.com/apache/iceberg/blob/ccb8bc435062171e64bc8b7e5f56e6aed9c5b934/core/src/main/java/org/apache/iceberg/rest/responses/GetNamespaceResponse.java#L55-L57).
   
   ## Are these changes tested?
   
   Yes, new unit tests.
   
   ## Are there any user-facing changes?
   
   No.
   


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