Skip to content

Commit 0697ec2

Browse files
authored
raise expected exception
1 parent 22a1c46 commit 0697ec2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pyiceberg/catalog/hive.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ def register_table(self, identifier: Union[str, Identifier], metadata_location:
471471
try:
472472
hive_table = open_client.get_tables(db_name=database_name, pattern=table_name).pop()
473473
except IndexError as e:
474-
raise NoSuchTableError(f"Table does not exists: {table_name}") from e
474+
raise NoSuchObjectException("get_table failed: unknown result") from e
475475

476476
return self._convert_hive_into_iceberg(hive_table)
477477

@@ -828,4 +828,3 @@ def drop_view(self, identifier: Union[str, Identifier]) -> None:
828828
def _get_default_warehouse_location(self, database_name: str, table_name: str) -> str:
829829
"""Override the default warehouse location to follow Hive-style conventions."""
830830
return self._get_hive_style_warehouse_location(database_name, table_name)
831-

0 commit comments

Comments
 (0)