-
Notifications
You must be signed in to change notification settings - Fork 3k
ExpireSnapshots: do not commit when no snapshots are expired. #22
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
ExpireSnapshots: do not commit when no snapshots are expired. #22
Conversation
|
@danielcweeks, can you review this? |
| TableMetadata updated = internalApply(); | ||
| ops.commit(base, updated); | ||
| // only commit the updated metadata if at least one snapshot was removed | ||
| if (updated.snapshots().size() != base.snapshots().size()) { |
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.
Would it be more precise to check for if (updated.snapshots().size() < base.snapshots().size())?
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.
I think those two checks are functionally equivalent for this check. This is to effectively check that the number of snapshots has not changed. I would err on the side of equality as the proposed change would conceptually mean that you could increase the number of snapshots, which would not be expected in this case.
|
+1 |
|
Thanks for the reviews! |
The CI is failing because a new version of mypy has been released yesterday: https://pypi.org/project/mypy/0.982/ (cherry picked from commit 2868871) Co-authored-by: Fokko Driesprong <fokko@apache.org>
No description provided.