Add tests for optimistic concurrency#1962
Merged
Fokko merged 5 commits intoapache:mainfrom May 15, 2025
Merged
Conversation
I think it would be great to also have integration tests that makes it easy to replicate certain scenarios. Added some simple ones, but we can extend by having two tables that modify a different partition etc.
Co-authored-by: smaheshwar-pltr <maheshwarsreesh@gmail.com>
…okko/iceberg-python into fd-add-test-for-optimistic-concurrency
Comment on lines
76
to
89
| @pytest.mark.integration | ||
| @pytest.mark.parametrize("format_version", [1, 2]) | ||
| def test_conflict_append_append( | ||
| spark: SparkSession, session_catalog: Catalog, arrow_table_with_null: pa.Table, format_version: int | ||
| ) -> None: | ||
| identifier = "default.test_conflict" | ||
| tbl1 = _create_table(session_catalog, identifier, {"format-version": format_version}, [arrow_table_with_null]) | ||
| tbl2 = session_catalog.load_table(identifier) | ||
|
|
||
| tbl1.append(arrow_table_with_null) | ||
|
|
||
| with pytest.raises(CommitFailedException, match="(branch main has changed: expected id ).*"): | ||
| # tbl2 isn't aware of the commit by tbl1 | ||
| tbl2.append(arrow_table_with_null) |
Member
Contributor
Author
There was a problem hiding this comment.
Thanks @hussein-awala for jumping in here. And that's correct, once the optimistic concurrency control has been added, they should start passing (for snapshot isolation, not for serializable isolation). I've added a comment, LMKWYT
gabeiglio
pushed a commit
to Netflix/iceberg-python
that referenced
this pull request
Aug 13, 2025
I think it would be great to also have integration tests that make it
easy to replicate certain scenarios.
Added some simple ones, but we can extend by having two tables that
modify a different partition etc.
<!--
Thanks for opening a pull request!
-->
<!-- In the case this PR will resolve an issue, please replace
${GITHUB_ISSUE_ID} below with the actual Github issue id. -->
<!-- Closes #${GITHUB_ISSUE_ID} -->
# Rationale for this change
# Are these changes tested?
# Are there any user-facing changes?
<!-- In the case of user-facing changes, please add the changelog label.
-->
---------
Co-authored-by: smaheshwar-pltr <maheshwarsreesh@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I think it would be great to also have integration tests that make it easy to replicate certain scenarios.
Added some simple ones, but we can extend by having two tables that modify a different partition etc.
Rationale for this change
Are these changes tested?
Are there any user-facing changes?