Skip to content
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

Fix update-requirement check to handle "no current snapshot" requirement properly #10064

Merged

Conversation

snazy
Copy link
Member

@snazy snazy commented Dec 9, 2024

The current implementation of the assert-ref-snapshot-id update requirement neglects the null requirement case, which means "there must be no current snapshot". The fix is simple. Also added a check that the ref-name in that requirement-check is main.

Also updated a few cases to eliminate IDE warnings in the same class.

Fixes #10062

…ent properly

The current implementation of the `assert-ref-snapshot-id` update requirement neglects the `null` requirement case, which means "there must be no current snapshot". The fix is simple. Also added a check that the ref-name in that requirement-check is `main`.

Also updated a few cases to eliminate IDE warnings in the same class.

Fixes projectnessie#10062
@snazy snazy requested a review from adutra December 9, 2024 11:36
@@ -702,6 +702,15 @@ interface SetSnapshotRef extends IcebergMetadataUpdate {

@Override
default void applyToTable(IcebergTableMetadataUpdateState state) {
checkState(
"main".equals(refName()) && "branch".equals(type()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be hard-coded to main or set to the repository's default branch?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is "Iceberg's main" - not Nessie's default branch. (Confusing, yea...)

@snazy snazy merged commit 8b3058b into projectnessie:main Dec 9, 2024
16 checks passed
@snazy snazy deleted the fix-null-snapshot-requirement-check branch December 9, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Newly created pyiceberg table does not detect commit conflicts
3 participants