Skip to content

Commit 7a39192

Browse files
authored
Add method and property around sequence-numbers (#60)
* Add method and property around sequence-numbers * Remove whitespace
1 parent 88cfe6d commit 7a39192

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pyiceberg/table/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,13 @@ def location(self) -> str:
529529
"""Return the table's base location."""
530530
return self.metadata.location
531531

532+
@property
533+
def last_sequence_number(self) -> int:
534+
return self.metadata.last_sequence_number
535+
536+
def next_sequence_number(self) -> int:
537+
return INITIAL_SEQUENCE_NUMBER if self.format_version == 1 else self.last_sequence_number + 1
538+
532539
def new_snapshot_id(self) -> int:
533540
"""Generate a new snapshot-id that's not in use."""
534541
snapshot_id = _generate_snapshot_id()

0 commit comments

Comments
 (0)