geruh commented on code in PR #3169:
URL: https://github.com/apache/iceberg-python/pull/3169#discussion_r3012545603


##########
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:
   I agree here, it's similar to what the restcatalog in the java 
implementation does today: 
   
   
https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java#L822
   
   which is populated in: 
   
https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/rest/responses/GetNamespaceResponse.java#L56



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