Skip to content

REST: Require metadata-location in view responses - #4152

Merged
geruh merged 1 commit into
apache:mainfrom
kevinjqliu:kevinjqliu-require-view-metadata-location
Oct 25, 2026
Merged

geruh merged 1 commit into
apache:mainfrom
kevinjqliu:kevinjqliu-require-view-metadata-location

Conversation

@kevinjqliu

Copy link
Copy Markdown
Contributor

Rationale for this change

The REST spec marks metadata-location as required in LoadViewResult (unlike LoadTableResult, where it is nullable for staged tables), and Java's LoadViewResponseParser rejects responses without it. This makes ViewResponse.metadata_location required to match.

Are these changes tested?

Yes, added test_load_view_missing_metadata_location.

  • uv run pytest tests/catalog/test_rest.py: 175 passed
  • make lint: passed

Are there any user-facing changes?

Yes. create_view, load_view, and register_view now raise a pydantic ValidationError when a REST server omits metadata-location.

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>
Copilot AI balanced review requested due to automatic review settings October 25, 2026 03:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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_location required and non-nullable for create, load, and register responses.
  • Adds a regression test confirming that loading a view without metadata-location raises ValidationError.
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

@kevinjqliu
kevinjqliu requested review from Fokko and geruh October 25, 2026 03:53
@geruh
geruh added this pull request to the merge queue Oct 25, 2026
Merged via the queue into apache:main with commit 5becad1 Oct 25, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants