Add method and property around sequence-numbers#60
Conversation
amogh-jahagirdar
left a comment
There was a problem hiding this comment.
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.
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.
Inspired by Java:
https://github.com/apache/iceberg/blob/b5ea0d5a7f55e5b8d9eec8e764bbcc35f8301db3/core/src/main/java/org/apache/iceberg/TableMetadata.java#L398-L404