Skip to content

Commit 82e5b90

Browse files
committed
Fixed comments and linter issues
1 parent 82e65e1 commit 82e5b90

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

tests/integration/test_writes/test_writes.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
from pyiceberg.io.pyarrow import _dataframe_to_data_files
4545
from pyiceberg.partitioning import PartitionField, PartitionSpec
4646
from pyiceberg.schema import Schema
47-
from pyiceberg.table import TableProperties, MAIN_BRANCH
47+
from pyiceberg.table import TableProperties
48+
from pyiceberg.table.refs import MAIN_BRANCH
4849
from pyiceberg.table.sorting import SortDirection, SortField, SortOrder
4950
from pyiceberg.transforms import DayTransform, HourTransform, IdentityTransform
5051
from pyiceberg.types import (
@@ -1578,7 +1579,9 @@ def test_abort_table_transaction_on_exception(
15781579
def test_append_to_non_existing_branch(session_catalog: Catalog, arrow_table_with_null: pa.Table) -> None:
15791580
identifier = "default.test_non_existing_branch"
15801581
tbl = _create_table(session_catalog, identifier, {"format-version": "2"}, [])
1581-
with pytest.raises(CommitFailedException, match=f"Table has no snapshots and can only be written to the {MAIN_BRANCH} BRANCH."):
1582+
with pytest.raises(
1583+
CommitFailedException, match=f"Table has no snapshots and can only be written to the {MAIN_BRANCH} BRANCH."
1584+
):
15821585
tbl.append(arrow_table_with_null, branch="non_existing_branch")
15831586

15841587

tests/table/test_init.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
_match_deletes_to_data_file,
5050
)
5151
from pyiceberg.table.metadata import INITIAL_SEQUENCE_NUMBER, TableMetadataUtil, TableMetadataV2, _generate_snapshot_id
52-
from pyiceberg.table.refs import SnapshotRef
52+
from pyiceberg.table.refs import SnapshotRef, SnapshotRefType
5353
from pyiceberg.table.snapshots import (
5454
MetadataLogEntry,
5555
Operation,
@@ -1012,6 +1012,10 @@ def test_assert_ref_snapshot_id(table_v2: Table) -> None:
10121012
AssertRefSnapshotId(ref="not_exist_tag", snapshot_id=1).validate(base_metadata)
10131013

10141014
# existing Tag in metadata: test
1015+
ref_tag = table_v2.refs().get("test")
1016+
assert ref_tag is not None
1017+
assert ref_tag.snapshot_ref_type == SnapshotRefType.TAG, "TAG test should be present in table to be tested"
1018+
10151019
with pytest.raises(
10161020
CommitFailedException,
10171021
match="Requirement failed: TAG test can't be updated once created",

0 commit comments

Comments
 (0)