Skip to content

Commit 7fba98b

Browse files
committed
small fix
1 parent dc4028b commit 7fba98b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pyiceberg/table/snapshots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def ancestor_right_before_timestamp(
425425
current_snapshot: Optional[Snapshot], table_metadata: TableMetadata, timestamp_ms: int
426426
) -> Optional[Snapshot]:
427427
"""Get the ancestor right before the given timestamp."""
428-
if current_snapshot is not None:
428+
if current_snapshot:
429429
for ancestor in ancestors_of(current_snapshot, table_metadata):
430430
if ancestor.timestamp_ms < timestamp_ms:
431431
return ancestor

tests/integration/test_snapshot_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_manage_snapshots_context_manager(catalog: Catalog) -> None:
5353
with tbl.manage_snapshots() as ms:
5454
ms.create_tag(snapshot_id=current_snapshot_id, tag_name="testing")
5555
ms.set_current_snapshot(snapshot_id=expected_snapshot_id)
56-
ms.create_tag(snapshot_id=expected_snapshot_id, tag_name="testing2")
56+
ms.create_branch(snapshot_id=expected_snapshot_id, branch_name="testing2")
5757
assert tbl.current_snapshot().snapshot_id is not current_snapshot_id # type: ignore
5858
assert tbl.metadata.refs["testing"].snapshot_id == current_snapshot_id
5959
assert tbl.metadata.refs["main"] == SnapshotRef(snapshot_id=expected_snapshot_id, snapshot_ref_type="branch")

0 commit comments

Comments
 (0)