You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "Soumo-git-hub (via GitHub)" <gi...@apache.org> on 2026/10/07 19:53:17 UTC

[PR] REST: Preserve view metadata location [iceberg-python]

Soumo-git-hub opened a new pull request, #4088:
URL: https://github.com/apache/iceberg-python/pull/4088

   Closes #4073
   
   # Rationale for this change
   
   REST view responses include `metadata-location`, but PyIceberg currently drops this value when constructing a `View`. As a result, callers cannot access the metadata file location returned by the REST catalog.
   
   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`.
   - Add regression coverage for `create_view`, `load_view`, and the shared `register_view` response path.
   
   ## Are these changes tested?
   
   Yes.
   
   - `python -m pytest tests/catalog/test_rest.py -m unit -v -p no:cacheprovider -k "test_create_view_200 or test_load_view_200 or test_register_view_200"` — **3 passed**
   - `python -m pytest tests/catalog/test_rest.py -m unit -v -p no:cacheprovider` — **167 passed**
   
   ## Are there any user-facing changes?
   
   Yes. `View` now exposes the metadata location returned by the REST catalog through `View.metadata_location`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] REST: Preserve view metadata location [iceberg-python]

Posted by "Soumo-git-hub (via GitHub)" <gi...@apache.org>.
Soumo-git-hub commented on code in PR #4088:
URL: https://github.com/apache/iceberg-python/pull/4088#discussion_r4240658767


##########
pyiceberg/view/__init__.py:
##########
@@ -30,16 +30,19 @@ class View:
     _identifier: Identifier
     metadata: ViewMetadata
     config: dict[str, str]
+    metadata_location: str | None

Review Comment:
   Yes, makes sense. I’ll add a short note clarifying that None applies when the location isn’t available such as direct construction or an absent REST response value.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] REST: Preserve view metadata location [iceberg-python]

Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on code in PR #4088:
URL: https://github.com/apache/iceberg-python/pull/4088#discussion_r4369497565


##########
pyiceberg/view/__init__.py:
##########


Review Comment:
   We should `metadata_location` in `View.__eq__` keeps views consistent with tables. 
   
   [`Table.__eq__`](https://github.com/apache/iceberg-python/blob/12d4a9a3ced73da290626bde6019ac2835d5c636/pyiceberg/table/__init__.py#L1864-L1870) already compares it, and in Java [`ViewMetadata`](https://github.com/apache/iceberg/blob/fb58513787756dedab6550d6695df36a27acb64e/core/src/main/java/org/apache/iceberg/view/ViewMetadata.java#L48-L87) equality includes `metadataFileLocation`. 
   
   Two views with identical metadata but different metadata files are unlikely in practice, but they still shouldn't compare equal.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] REST: Preserve view metadata location [iceberg-python]

Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu merged PR #4088:
URL: https://github.com/apache/iceberg-python/pull/4088


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] REST: Preserve view metadata location [iceberg-python]

Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on code in PR #4088:
URL: https://github.com/apache/iceberg-python/pull/4088#discussion_r4369497565


##########
pyiceberg/view/__init__.py:
##########


Review Comment:
   I think we should include `metadata_location` in `View.__eq__` keeps views consistent with tables. 
   
   [`Table.__eq__`](https://github.com/apache/iceberg-python/blob/12d4a9a3ced73da290626bde6019ac2835d5c636/pyiceberg/table/__init__.py#L1864-L1870) already compares it, and in Java [`ViewMetadata`](https://github.com/apache/iceberg/blob/fb58513787756dedab6550d6695df36a27acb64e/core/src/main/java/org/apache/iceberg/view/ViewMetadata.java#L48-L87) equality includes `metadataFileLocation`. Two views pointing at different metadata files shouldn't compare equal.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] REST: Preserve view metadata location [iceberg-python]

Posted by "ebyhr (via GitHub)" <gi...@apache.org>.
ebyhr commented on code in PR #4088:
URL: https://github.com/apache/iceberg-python/pull/4088#discussion_r4213280156


##########
pyiceberg/view/__init__.py:
##########
@@ -30,16 +30,19 @@ class View:
     _identifier: Identifier
     metadata: ViewMetadata
     config: dict[str, str]
+    metadata_location: str | None

Review Comment:
   nit: The REST spec marks `metadata-location` as required, but `ViewResponse` already makes it optional, so `str | None` is consistent. Could we document when it's None?



##########
pyiceberg/view/__init__.py:
##########


Review Comment:
   nit: `__eq__` ignores `metadata_location`. That seems intentional, but a short comment saying so might be helpful.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] REST: Preserve view metadata location [iceberg-python]

Posted by "Soumo-git-hub (via GitHub)" <gi...@apache.org>.
Soumo-git-hub commented on code in PR #4088:
URL: https://github.com/apache/iceberg-python/pull/4088#discussion_r4240660689


##########
pyiceberg/view/__init__.py:
##########


Review Comment:
   Yes, that’s intentional. I’ll add a short comment clarifying that view equality remains based on identifier and metadata not the metadata file location.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] REST: Preserve view metadata location [iceberg-python]

Posted by "Soumo-git-hub (via GitHub)" <gi...@apache.org>.
Soumo-git-hub commented on PR #4088:
URL: https://github.com/apache/iceberg-python/pull/4088#issuecomment-6361789993

   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org