geruh commented on code in PR #3169:
URL: https://github.com/apache/iceberg-python/pull/3169#discussion_r2968732437
##########
pyiceberg/catalog/rest/__init__.py:
##########
@@ -337,7 +337,14 @@ class ListNamespaceResponse(IcebergBaseModel):
class NamespaceResponse(IcebergBaseModel):
namespace: Identifier = Field()
- properties: Properties = Field()
+ properties: Properties = Field(default_factory=dict)
+
+ @field_validator("properties", mode="before")
+ @classmethod
+ def replace_none_with_dict(cls, v: Any) -> Properties:
+ if v is None:
+ return {}
+ return v
Review Comment:
This would allow none through to the properties field since the
default_factory only applies when the field is ommitted from the response. It
would be easier to normalize at the deserialization layer to not miss out on
the null checks within the code base but we can.
--
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]