Skip to content

Conversation

@Fokko
Copy link
Contributor

@Fokko Fokko commented May 2, 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.

Rationale for this change

Are these changes tested?

Are there any user-facing changes?

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.
Fokko and others added 3 commits May 3, 2025 20:52
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)
Copy link
Member

Choose a reason for hiding this comment

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

Actually, this shouldn't fail, but it does with the current OCC implementation, we may add a todo comment to remove it when #819 is completed, to indicate to the developer working on #1929 that it is safe to remove/update this test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Collaborator

@sungwy sungwy left a comment

Choose a reason for hiding this comment

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

Sorry for the late review @Fokko - this looks good to me. Excited to see how this test evolves with the introduction of optimistic concurrency features

@Fokko Fokko merged commit 7466adf into apache:main May 15, 2025
7 checks passed
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>
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.

4 participants