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


##########
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 think we actually want to pass `null` through; for this scenario
   
   >             If the server does not support namespace properties, it should 
return null for this field.
   
   and make `load_namespace_properties` return both `Properties` and `None`
   * `None` for not supported
   * `Properties` for none are set
   
   
https://github.com/apache/iceberg-python/blob/4071d39f13fb8004d8d84827fca0d51d766ff114/pyiceberg/catalog/__init__.py#L648
   
   
   Wdyt?



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