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

Python: Fix warnings from pytest #6703

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,16 @@ gcsfs = ["gcsfs"]

[tool.pytest.ini_options]
markers = [
"unmarked: unmarked tests",
"s3: marks a test as requiring access to s3 compliant storage (use with --aws-access-key-id, --aws-secret-access-key, and --endpoint args)",
"adlfs: marks a test as requiring access to adlfs compliant storage (use with --adlfs.account-name, --adlfs.account-key, and --adlfs.endpoint args)",
"integration: marks integration tests against Apache Spark",
"gcs: marks a test as requiring access to gcs compliant storage (use with --gs.token, --gs.project, and --gs.endpoint)"
]
# Turns a warning into an error
filterwarnings = [
"error"
]

[tool.black]
line-length = 130
Expand Down
2 changes: 2 additions & 0 deletions python/tests/catalog/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# under the License.

import os
import warnings
from pathlib import Path
from typing import Generator, List

Expand Down Expand Up @@ -275,6 +276,7 @@ def test_create_namespace_with_comment_and_location(test_catalog: SqlCatalog, da
assert properties["location"] == test_location


@pytest.mark.filterwarnings("ignore")
def test_create_namespace_with_null_properties(test_catalog: SqlCatalog, database_name: str) -> None:
with pytest.raises(IntegrityError):
test_catalog.create_namespace(namespace=database_name, properties={None: "value"}) # type: ignore
Expand Down
1 change: 1 addition & 0 deletions python/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,7 @@ def adlfs_fsspec_fileio(request: pytest.FixtureRequest) -> Generator[FsspecFileI
bbs.create_container("tests")
yield fsspec.FsspecFileIO(properties=properties)
bbs.delete_container("tests")
bbs.close()


@pytest.fixture(scope="session")
Expand Down
2 changes: 2 additions & 0 deletions python/tests/io/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,14 @@ def test_load_file_io_location_no_schema() -> None:
assert isinstance(load_file_io({"location": "/no-schema/"}), PyArrowFileIO)


@pytest.mark.filterwarnings("ignore")
def test_mock_warehouse_location_file_io() -> None:
# For testing the selection logic
io = load_file_io({"warehouse": "test://some-path/"})
assert io.properties["warehouse"] == "test://some-path/"


@pytest.mark.filterwarnings("ignore")
def test_mock_table_location_file_io() -> None:
# For testing the selection logic
io = load_file_io({}, "test://some-path/")
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 @@ -432,6 +432,7 @@ def test_void_transform() -> None:

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

Choose a reason for hiding this comment

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

Was this fixed in the other PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that was a PR to the 0.3.0 branch, so we can create another RC from that branch without having the latest pyarrow changes released along with it.



def test_bucket_transform_serialize() -> None:
Expand Down