Skip to content

REST: Preserve view metadata location - #4088

Merged
kevinjqliu merged 3 commits into
apache:mainfrom
Soumo-git-hub:fix/4073-view-metadata-location
Oct 25, 2026
Merged

kevinjqliu merged 3 commits into
apache:mainfrom
Soumo-git-hub:fix/4073-view-metadata-location

Conversation

@Soumo-git-hub

@Soumo-git-hub Soumo-git-hub commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Closes #4073

Rationale for this change

REST view responses include metadata-location (required in LoadViewResult by the REST spec), but PyIceberg drops this value when constructing a View. As a result, callers cannot access the metadata file location returned by the REST catalog, unlike Table.metadata_location.

This change preserves the response value on View.metadata_location.

What changed

  • Add an optional metadata_location attribute to View while preserving the existing constructor argument order.
  • Propagate ViewResponse.metadata_location through RestCatalog._response_to_view.
  • Include metadata_location in View.__eq__, consistent with Table.__eq__.
  • Add regression coverage for create_view, load_view, and register_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 passed
  • uv 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 the rest and object-store services from dev/docker-compose-integration.yml) — 6 passed
  • prek hooks (ruff, ruff format, mypy) on changed files — passed

Are there any user-facing changes?

Yes.

  • View now exposes the metadata location returned by the REST catalog through View.metadata_location (None for directly constructed views).
  • View.__eq__ now also compares metadata_location, so two views are equal only if they also point to the same metadata file.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Assignees

Couldn't load assignees.