Skip to content

Commit a491c02

Browse files
committed
test: avoid mypy unreachable in update builder regression
1 parent 605a92f commit a491c02

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

pyiceberg/table/update/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ def _commit(self) -> UpdatesAndRequirements: ...
7272
def commit(self) -> None:
7373
self._transaction._apply(*self._commit())
7474

75-
def __exit__(
76-
self, exctype: type[BaseException] | None, excinst: BaseException | None, exctb: TracebackType | None
77-
) -> None:
75+
def __exit__(self, exctype: type[BaseException] | None, excinst: BaseException | None, exctb: TracebackType | None) -> None:
7876
"""Close and commit the change if no exceptions have been raised."""
7977
if exctype is None and excinst is None and exctb is None:
8078
self.commit()

tests/catalog/test_catalog_behaviors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,10 +948,10 @@ def test_update_schema_with_statement_does_not_commit_on_exception(
948948
catalog.create_namespace(namespace)
949949
table = catalog.create_table(random_table_identifier, table_schema_simple)
950950

951-
with pytest.raises(RuntimeError, match="boom"):
951+
with pytest.raises(ValueError):
952952
with table.update_schema() as tx:
953953
tx.add_column(path="should_not_commit", field_type=IntegerType())
954-
raise RuntimeError("boom")
954+
int("boom")
955955

956956
assert table.schema() == table_schema_simple
957957
assert table.schema().schema_id == 0

0 commit comments

Comments
 (0)