Repository navigation
REST: Preserve view metadata location - #4088
Merged
kevinjqliu merged 3 commits intoOct 25, 2026
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4073
Rationale for this change
REST view responses include
metadata-location(required inLoadViewResultby the REST spec), but PyIceberg drops this value when constructing aView. As a result, callers cannot access the metadata file location returned by the REST catalog, unlikeTable.metadata_location.This change preserves the response value on
View.metadata_location.What changed
metadata_locationattribute toViewwhile preserving the existing constructor argument order.ViewResponse.metadata_locationthroughRestCatalog._response_to_view.metadata_locationinView.__eq__, consistent withTable.__eq__.create_view,load_view, andregister_view, and assert the location end-to-end in the REST integration test.Are these changes tested?
Yes.
uv run --extra pyarrow pytest tests/catalog/test_rest.py tests/test_view.py -q -p no:cacheprovider— 191 passeduv run --extra pyarrow --extra s3fs --extra hive --extra sql-sqlite python -m pytest tests/integration/test_rest_catalog.py tests/integration/test_catalog.py -k view -m integration -q -p no:cacheprovider(against therestandobject-storeservices fromdev/docker-compose-integration.yml) — 6 passedprekhooks (ruff, ruff format, mypy) on changed files — passedAre there any user-facing changes?
Yes.
Viewnow exposes the metadata location returned by the REST catalog throughView.metadata_location(Nonefor directly constructed views).View.__eq__now also comparesmetadata_location, so two views are equal only if they also point to the same metadata file.