Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
table_exist -> table_exists
  • Loading branch information
anupam-saini committed Mar 11, 2024
commit 9fc1b63edd07c3143c9df353a41ddfae4559ca8a
2 changes: 1 addition & 1 deletion pyiceberg/catalog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ 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_exist(self, identifier: Union[str, Identifier]) -> bool:
def table_exists(self, identifier: Union[str, Identifier]) -> bool:
try:
self.load_table(identifier)
return True
Expand Down
8 changes: 4 additions & 4 deletions tests/catalog/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,15 +377,15 @@ def test_table_raises_error_on_table_not_found(catalog: InMemoryCatalog) -> None
catalog.load_table(TEST_TABLE_IDENTIFIER)


def test_table_exist(catalog: InMemoryCatalog) -> None:
def test_table_exists(catalog: InMemoryCatalog) -> None:
# Given
given_catalog_has_a_table(catalog)
# Then
assert catalog.table_exist(TEST_TABLE_IDENTIFIER)
assert catalog.table_exists(TEST_TABLE_IDENTIFIER)


def test_table_exist_on_table_not_found(catalog: InMemoryCatalog) -> None:
assert not catalog.table_exist(TEST_TABLE_IDENTIFIER)
def test_table_exists_on_table_not_found(catalog: InMemoryCatalog) -> None:
assert not catalog.table_exists(TEST_TABLE_IDENTIFIER)


def test_drop_table(catalog: InMemoryCatalog) -> None:
Expand Down