You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RestCatalog.update_namespace_properties fails when the server omits the optional "missing" field聽#4066
RestCatalog.update_namespace_properties raises a pydantic ValidationError when the server's response omits the missing field, even though the update was applied. The REST spec makes missing optional, but pyiceberg's response model requires it. The model is unchanged on main.
The spec (open-api/rest-catalog-open-api.yaml):
UpdateNamespacePropertiesResponse:
type: objectrequired:
- updated
- removedproperties:
...missing:
type: arrayitems:
type: stringdescription:
List of properties requested for removal that were not foundin the namespace's properties. Represents a partial success response.Server's do not need to implement this.nullable: true
pyiceberg (pyiceberg/catalog/rest/__init__.py, unchanged on main):
classUpdateNamespacePropertiesResponse(IcebergBaseModel):
removed: list[str] =Field()
updated: list[str] =Field()
missing: list[str] =Field() # required, but optional per the spec
Servers that omit it.Lakekeeper leaves missing out when nothing was missing (skip_serializing_if = "Option::is_none"), as does the UpdateNamespacePropertiesResponse type in iceberg-rust (crates/catalog/rest/src/types.rs). So with Lakekeeper, any removal where every requested key exists fails in pyiceberg.
The server answers 200 {"updated":[],"removed":["a","b"]} and applies the change, but pyiceberg raises:
pydantic_core._pydantic_core.ValidationError: 1 validation error for UpdateNamespacePropertiesResponse
missing
Field required [type=missing, input_value={'updated': [], 'removed': ['a', 'b']}, input_type=dict]
load_namespace_properties(("probe",)) afterwards shows a and b are gone. When at least one requested key is absent, the server includes "missing": [...] and the call succeeds.
Expected: the call returns a PropertiesUpdateSummary with missing=[] (or None).
Suggested fix: make the field optional, defaulting to empty, so PropertiesUpdateSummary stays unchanged for callers:
missing: list[str] =Field(default_factory=list)
Willingness to contribute
I can contribute a fix for this bug independently
I would be willing to contribute a fix for this bug with guidance from the Iceberg community
I cannot contribute a fix for this bug at this time
Activity