-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add method and property around sequence-numbers #60
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me once the linter is passing!
Also seems like a few of these APIs are missing like last updated time, last column id, uuid. I can put out a PR to bring this to parity. |
Actually nvm on the new APIs, I was confusing with TableMetadata. I do think having table.uuid() would be useful, that came up recently internally. I'll propose that in the Java library first though to see the community's thoughts. |
@amogh-jahagirdar thanks for the review, appreciate it. I'm adding them once we start using them, but if you see anything missing that would be useful on its own, feel free to raise a PR |
def last_sequence_number(self) -> int: | ||
return self.metadata.last_sequence_number | ||
|
||
def next_sequence_number(self) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: In Java, this is on TableMetadata, which is an internal class and not part of the public API. I don't think anyone would call this externally, but if they did it may not be accurate because the sequence number could be reassigned for a new snapshot if the commit needs to be retried. I'd probably make this _next_sequence_number()
to avoid that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, I'll add this to #23
Inspired by Java:
https://github.com/apache/iceberg/blob/b5ea0d5a7f55e5b8d9eec8e764bbcc35f8301db3/core/src/main/java/org/apache/iceberg/TableMetadata.java#L398-L404