View does not expose metadata_location: RestCatalog.load_view discards it from the server's response
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
Research direction
Start in pyiceberg/catalog/rest/init.py at _response_to_view, comparing it with _response_to_table and the ViewResponse model. Verify that load_view and create_view preserve the REST metadata-location value and that the resulting View exposes it for the register_view use case described in the issue.
Written by the indexing model from the issue text.
Description
Apache Iceberg version
0.12.0 (latest release)
Please describe the bug 🐞
RestCatalog.load_view (and create_view) parse the server's metadata-location but drop it when building the View, so callers cannot learn where a view's current metadata file is. Tables keep it as Table.metadata_location; views have no equivalent. The behaviour is unchanged on main.
The spec (open-api/rest-catalog-open-api.yaml) requires the field in every view load result:
LoadViewResult:
required:
- metadata-location
- metadata
with the description: "The corresponding file location of view metadata is returned in the metadata-location field. Clients can check whether metadata has changed by comparing metadata locations after the view has been created."
pyiceberg parses it, then discards it (pyiceberg/catalog/rest/__init__.py on main):
class ViewResponse(IcebergBaseModel):
metadata_location: str | None = Field(alias="metadata-location", default=None)
metadata: ViewMetadata
config: Properties = Field(default_factory=dict)
def _response_to_view(self, identifier_tuple, view_response: ViewResponse) -> View:
return View(
identifier=identifier_tuple,
metadata=view_response.metadata,
config=view_response.config,
) # view_response.metadata_location is never passed on
_response_to_table, by contrast, passes metadata_location=table_response.metadata_location to Table.
Why it matters: without it, a client cannot detect changes to a view the way the spec suggests (comparing metadata locations), record where a view's metadata lives, or re-register a view from that file later with register_view.
Expected: View exposes metadata_location, set from the REST response, like Table.metadata_location.
PR #3390 ("REST: Add metadata_location to View, and register_view integration test") addressed this but was closed unmerged. Related umbrella issue: #818.
Willingness to contribute
- I can contribute a fix for this bug independently
- I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- I cannot contribute a fix for this bug at this time
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 618
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 70
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/iceberg-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
apache/iceberg-python#4093 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
apache/iceberg-python#4010 · 3 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
to_bytes silently rescales a Decimal with a negative scalePossibly taken @Rodrigo-Palma claimed this 24 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/iceberg-python#3996 ·
Maintainers usually reply within 1 day
-
Deletion vector bitmap count is read from the blob and used as a loop bound without validationPossibly taken @ghoshp83 claimed this 24 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/iceberg-python#3979 ·
Maintainers usually reply within 1 day
-
FsspecFileIO: `_adls` mutates shared properties, so a second storage account gets the first account's filesystemPossibly taken @krishnakaanchan-png claimed this 41 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/iceberg-python#3885 ·
Maintainers usually reply within 1 day
All issues in apache/iceberg-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
vllm-project/vllm#61131 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
kubernetes-client/python#2735 ·
Maintainers usually reply within 1 day
-
desktop help wanted test
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
docs pydanty:is-working
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pydantic/pydantic-ai#10113 ·
Maintainers usually reply within 1 day
-
Tutorial unit test leaks sample data into tutorial doctestPossibly taken @Gambit-Checkmate claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100