Skip to content

Make add_files to support snapshot_properties argument #695

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

Merged
merged 3 commits into from
May 7, 2024

Conversation

enkidulan
Copy link
Contributor

Issue #694

I'm not sure where to add tests. Is tests/catalog/test_glue.py the right place?

@sungwy
Copy link
Collaborator

sungwy commented May 2, 2024

@enkidulan - thank you for working on this. I think https://github.com/apache/iceberg-python/blob/main/tests/integration/test_add_files.py is the right place for these tests

@@ -122,8 +123,13 @@ def _create_table(
return tbl


@pytest.fixture(name="format_version", params=[pytest.param(1, id="format_version=1"), pytest.param(2, id="format_version=2")])
def format_version_fixure(request: pytest.FixtureRequest) -> Iterator[int]:
Copy link
Contributor Author

@enkidulan enkidulan May 2, 2024

Choose a reason for hiding this comment

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

Making params more human-friendly:

test_add_files_to_unpartitioned_table[format_version=1] PASSED
test_add_files_to_unpartitioned_table[format_version=2] PASSED
..
# instead of 
test_add_files_to_unpartitioned_table[1] PASSED
test_add_files_to_unpartitioned_table[2] PASSED

@enkidulan
Copy link
Contributor Author

Thanks @syun64. I've added the tests

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.

LGTM. Thank you for adding this in!

Copy link
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

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

lgtm! love the format_version change

Copy link
Contributor

@HonahX HonahX left a comment

Choose a reason for hiding this comment

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

It looks great! Thanks @enkidulan.

@enkidulan
Copy link
Contributor Author

I pushed a small update to make Python 3.8 tests pass. I had to replace collections.abc.Iterator with typing.Iterator, as the former only supports subscripting starting with Python 3.9 - https://docs.python.org/3.11/library/typing.html#typing.Iterator.
Sorry that I haven't done that from the start. For some reason, CI only now notified me about the build failing.

@HonahX
Copy link
Contributor

HonahX commented May 7, 2024

@enkidulan Thanks for fixing the test and the great work! Thanks @syun64 and @kevinjqliu for reviewing. Merging!

@HonahX HonahX merged commit 990ce80 into apache:main May 7, 2024
7 checks passed
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