Repository navigation
REST: Require metadata-location in view responses - #4152
Merged
geruh merged 1 commit intoOct 25, 2026
Merged
Conversation
The REST spec marks metadata-location as required in LoadViewResult, and Java's LoadViewResponseParser rejects responses without it. Make ViewResponse.metadata_location required to match. Behavior change: create_view, load_view, and register_view now raise a pydantic ValidationError for non-compliant servers that omit metadata-location, instead of silently accepting the response. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused validation change consistently applies to view responses, includes regression coverage, and has no identified blocking issues.
No open issues 🎉
What changed in this PR
Aligns REST view-response validation with the specification by requiring metadata-location.
Changes:
- Makes
ViewResponse.metadata_locationrequired and non-nullable for create, load, and register responses. - Adds a regression test confirming that loading a view without
metadata-locationraisesValidationError.
| File | Description |
|---|---|
tests/catalog/test_rest.py |
Tests rejection of a view response missing metadata-location. |
pyiceberg/catalog/rest/__init__.py |
Requires a non-null metadata location in ViewResponse. |
Review effort: Balanced
rambleraptor
approved these changes
Oct 25, 2026
ebyhr
approved these changes
Oct 25, 2026
geruh
approved these changes
Oct 25, 2026
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.
Rationale for this change
The REST spec marks
metadata-locationas required inLoadViewResult(unlikeLoadTableResult, where it is nullable for staged tables), and Java'sLoadViewResponseParserrejects responses without it. This makesViewResponse.metadata_locationrequired to match.Are these changes tested?
Yes, added
test_load_view_missing_metadata_location.uv run pytest tests/catalog/test_rest.py: 175 passedmake lint: passedAre there any user-facing changes?
Yes.
create_view,load_view, andregister_viewnow raise a pydanticValidationErrorwhen a REST server omitsmetadata-location.