Skip to content

Commit ee591b4

Browse files
committed
Added another integration test
1 parent b7b8ba0 commit ee591b4

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/integration/test_writes/test_writes.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,3 +1522,28 @@ def test_overwrite_to_existing_branch(session_catalog: Catalog, arrow_table_with
15221522
assert (
15231523
delete_snapshot.parent_snapshot_id == main_snapshot.snapshot_id
15241524
) # Currently overwrite is a delete followed by an append operation
1525+
1526+
1527+
@pytest.mark.integration
1528+
def test_intertwined_branch_writes(session_catalog: Catalog, arrow_table_with_null: pa.Table) -> None:
1529+
identifier = "default.test_concurrent_branch_operations"
1530+
branch1 = "existing_branch_1"
1531+
branch2 = "existing_branch_2"
1532+
1533+
tbl = _create_table(session_catalog, identifier, {"format-version": "2"}, [arrow_table_with_null])
1534+
1535+
assert tbl.metadata.current_snapshot_id is not None
1536+
1537+
tbl.manage_snapshots().create_branch(snapshot_id=tbl.metadata.current_snapshot_id, branch_name=branch1).commit()
1538+
1539+
tbl.delete("int = 9", branch=branch1)
1540+
1541+
tbl.append(arrow_table_with_null)
1542+
1543+
tbl.manage_snapshots().create_branch(snapshot_id=tbl.metadata.current_snapshot_id, branch_name=branch2).commit()
1544+
1545+
tbl.overwrite(arrow_table_with_null, branch=branch2)
1546+
1547+
assert len(tbl.scan().use_ref(branch1).to_arrow()) == 2
1548+
assert len(tbl.scan().use_ref(branch2).to_arrow()) == 3
1549+
assert len(tbl.scan().to_arrow()) == 6

0 commit comments

Comments
 (0)