You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "syun64 (via GitHub)" <gi...@apache.org> on 2024/03/11 12:49:19 UTC

Re: [PR] Add `table_exists` method to Catalog [iceberg-python]

syun64 commented on code in PR #512:
URL: https://github.com/apache/iceberg-python/pull/512#discussion_r1519661896


##########
pyiceberg/catalog/__init__.py:
##########
@@ -646,6 +646,13 @@ def purge_table(self, identifier: Union[str, Identifier]) -> None:
         delete_files(io, prev_metadata_files, PREVIOUS_METADATA)
         delete_files(io, {table.metadata_location}, METADATA)
 
+    def table_exists(self, identifier: Union[str, Identifier]) -> bool:

Review Comment:
   Hi @anupam-saini This looks great! In addition to this default behavior, I think there is a suggestion on #507 to override this method in [catalog/rest.py](https://github.com/apache/iceberg-python/blob/pyiceberg-0.6.x/pyiceberg/catalog/rest.py) to instead make a head request to the Rest Catalog at [/v1/{prefix}/namespaces/{namespace}/tables/{table}](https://github.com/apache/iceberg/blob/main/open-api/rest-catalog-open-api.yaml#L814) endpoint. Shall we incorporate that suggestion to use the available endpoint in the Rest Catalog?



-- 
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