Skip to content

Commit

Permalink
table_exist -> table_exists
Browse files Browse the repository at this point in the history
  • Loading branch information
anupam-saini committed Mar 11, 2024
1 parent cac570c commit 9fc1b63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit 9fc1b63

Please sign in to comment.