Repository navigation
REST: Preserve view metadata location - #4088
Merged
kevinjqliu merged 3 commits intoOct 25, 2026
Merged
Conversation
rambleraptor
approved these changes
Oct 7, 2026
rambleraptor
left a comment
Collaborator
There was a problem hiding this comment.
This looks great! Thanks for contributing this fix!
ebyhr
approved these changes
Oct 8, 2026
Contributor
Author
|
Hi @ebyhr, I've pushed the follow-up changes addressing your suggestions. Thanks again for the review! Please let me know if anything else is needed from my side. |
kevinjqliu
force-pushed
the
fix/4073-view-metadata-location
branch
from
October 25, 2026 00:51
1a696a4 to
5866285
Compare
Match Table.__eq__ and the REST spec, which uses metadata location to detect view changes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kevinjqliu
approved these changes
Oct 25, 2026
kevinjqliu
left a comment
Contributor
There was a problem hiding this comment.
LGTM
I added a commit (8592d7d) to include metadata_location in View.__eq__ and fixed the tests to match
kevinjqliu
enabled auto-merge
October 25, 2026 03:20
kevinjqliu
added a commit
to kevinjqliu/iceberg-python
that referenced
this pull request
Oct 25, 2026
Register the created view under a second name that needs URL encoding, now that View exposes its metadata location (apache#4088). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kevinjqliu
added a commit
to rambleraptor/iceberg-python
that referenced
this pull request
Oct 25, 2026
…dies (apache#4151) * REST: Send raw view name in create_view and register_view bodies create_view and register_view took the view name from _split_identifier_for_path, which URL-quotes it for use as a path segment, and put it in the JSON request body. A view named "my view" was created as "my%20view". Use the raw name, as create_table and register_table already do. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Test REST identifiers that need URL encoding against the REST fixture Round-trip namespace, table, and view names containing spaces, reserved URL characters, and non-ASCII text through path, query, and body parameters. This catches encoding mistakes like the double-encoded list_namespaces parent and the encoded view name in create_view. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Cover commit_table in REST identifier integration test commit_table is the only caller of the TableIdentifier branch of _split_identifier_for_path, so table updates had no coverage for names that need URL encoding. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Clarify why % is omitted from REST identifier integration test Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Keep _split_identifier_for_path for the register_view path Matches create_view and register_table: path from _split_identifier_for_path, raw name for the body. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Cover register_view in REST identifier integration test Register the created view under a second name that needs URL encoding, now that View exposes its metadata location (apache#4088). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.