Skip to content

Commit

Permalink
Python: Fix warnings from PyLint
Browse files Browse the repository at this point in the history
Because TestType contains test in the name,
pytest tries to collect it and run tests on it.
Setting `__test__ = False` tells PyTest to ignore it

Also, s3 emits an error because we clean up buckets that
still has content in it, so I've added some code to clean them
up after we use the bucket.
  • Loading branch information
Fokko committed Jan 30, 2023
1 parent 81bf8d3 commit 11889e0
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
4 changes: 4 additions & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ markers = [
"s3: marks a test as requiring access to s3 compliant storage (use with --aws-access-key-id, --aws-secret-access-key, and --endpoint-url args)",
"adlfs: marks a test as requiring access to adlfs compliant storage (use with --adlfs.account-name, --adlfs.account-key, and --adlfs.endpoint args)"
]
# Turns an warning into an error
filterwarnings = [
"error"
]

[tool.black]
line-length = 130
Expand Down
32 changes: 32 additions & 0 deletions python/release-announcement-email.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
To: dev@iceberg.apache.org
Subject: [VOTE] Release Apache PyIceberg
Hi Everyone,

I propose that we release the following RC as the official PyIceberg release.

The commit ID is

* This corresponds to the tag: ()
* https://github.com/apache/iceberg/releases/tag/
* https://github.com/apache/iceberg/tree/

The release tarball, signature, and checksums are here:

* https://dist.apache.org/repos/dist/dev/iceberg/pyiceberg-/

You can find the KEYS file here:

* https://dist.apache.org/repos/dist/dev/iceberg/KEYS

Convenience binary artifacts are staged on pypi:

https://pypi.org/project/pyiceberg//

And can be installed using: pip3 install pyiceberg==

Please download, verify, and test.

Please vote in the next 72 hours.
[ ] +1 Release this as PyIceberg
[ ] +0
[ ] -1 Do not release this because...
13 changes: 12 additions & 1 deletion python/tests/catalog/test_glue.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,18 @@ def get_random_databases(n: int) -> Set[str]:

@pytest.fixture(name="_bucket_initialize")
def fixture_s3_bucket(_s3) -> None: # type: ignore
_s3.create_bucket(Bucket=BUCKET_NAME)
bucket = _s3.create_bucket(Bucket=BUCKET_NAME)
yield bucket

response = _s3.list_objects_v2(
Bucket=BUCKET_NAME,
)
while response["KeyCount"] > 0:
_s3.delete_objects(Bucket=BUCKET_NAME, Delete={"Objects": [{"Key": obj["Key"]} for obj in response["Contents"]]})
response = _s3.list_objects_v2(
Bucket=BUCKET_NAME,
)
_s3.delete_bucket(Bucket=BUCKET_NAME)


@mock_glue
Expand Down
1 change: 1 addition & 0 deletions python/tests/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ def test_void_transform() -> None:

class TestType(IcebergBaseModel):
__root__: Transform[Any, Any]
__test__ = False


def test_bucket_transform_serialize() -> None:
Expand Down

0 comments on commit 11889e0

Please sign in to comment.