mayuriphad opened a new pull request, #4074:
URL: https://github.com/apache/iceberg-python/pull/4074
Closes #4066
# Rationale for this change
In the REST spec, `UpdateNamespacePropertiesResponse` requires only
`updated` and `removed`. `missing` is optional and `nullable: true` ("Server's
do not need to implement this"). pyiceberg's response model declared `missing:
list[str] = Field()` as required. So against a server that omits it
(Lakekeeper, or anything built on iceberg-rust's response type),
`RestCatalog.update_namespace_properties` raised:
```
pydantic_core._pydantic_core.ValidationError: 1 validation error for
UpdateNamespacePropertiesResponse
missing
Field required [type=missing, input_value={'updated': [], 'removed': ['a',
'b']}, input_type=dict]
```
That happens after the server had already applied the update.
`missing` now defaults to an empty list, and an explicit `null` is mapped to
`[]`. That keeps `PropertiesUpdateSummary.missing` a `list[str]` as before, so
callers see no type change.
# Are these changes tested?
Yes. `test_update_namespace_properties_200_without_missing` covers a
response that omits `missing` and one with `"missing": null`. Both fail on
`main` with the `ValidationError` above and pass with this change. The rest of
`tests/catalog/test_rest.py` passes locally, except
`test_rest_catalog_with_google_credentials_path`, which fails on `main` too
because `google-auth` isn't installed in my environment.
# Are there any user-facing changes?
Yes, a bug fix: `update_namespace_properties` works with REST servers that
omit the optional `missing` field.
--
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]