diff --git a/pyiceberg/manifest.py b/pyiceberg/manifest.py index fdebfee5dc..ec7c218b1c 100644 --- a/pyiceberg/manifest.py +++ b/pyiceberg/manifest.py @@ -783,8 +783,8 @@ def __init__(self, spec: PartitionSpec, schema: Schema, output_file: OutputFile, output_file, snapshot_id, { - "schema": schema.json(), - "partition-spec": spec.json(), + "schema": schema.model_dump_json(), + "partition-spec": spec.model_dump_json(), "partition-spec-id": str(spec.spec_id), "format-version": "1", }, @@ -808,9 +808,9 @@ def __init__(self, spec: PartitionSpec, schema: Schema, output_file: OutputFile, schema, output_file, snapshot_id, - { - "schema": schema.json(), - "partition-spec": spec.json(), + meta={ + "schema": schema.model_dump_json(), + "partition-spec": spec.model_dump_json(), "partition-spec-id": str(spec.spec_id), "format-version": "2", "content": "data", diff --git a/pyproject.toml b/pyproject.toml index 170f8d74fb..63cdc4cbff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -122,6 +122,11 @@ markers = [ "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 target-version = ['py38'] diff --git a/tests/catalog/test_sql.py b/tests/catalog/test_sql.py index 41bb5c76b8..4277845633 100644 --- a/tests/catalog/test_sql.py +++ b/tests/catalog/test_sql.py @@ -304,6 +304,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 diff --git a/tests/conftest.py b/tests/conftest.py index 79c01dc747..c122649593 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1545,6 +1545,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") diff --git a/tests/io/test_io.py b/tests/io/test_io.py index c4dc3d45a5..d27274e17e 100644 --- a/tests/io/test_io.py +++ b/tests/io/test_io.py @@ -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/") diff --git a/tests/io/test_pyarrow_stats.py b/tests/io/test_pyarrow_stats.py index 74297fe526..6f00061174 100644 --- a/tests/io/test_pyarrow_stats.py +++ b/tests/io/test_pyarrow_stats.py @@ -76,6 +76,7 @@ @dataclass(frozen=True) class TestStruct: + __test__ = False x: Optional[int] y: Optional[float] diff --git a/tests/test_integration.py b/tests/test_integration.py index 4683aa8853..6650cd345c 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -194,6 +194,7 @@ def test_pyarrow_limit(table_test_limit: Table) -> None: assert len(full_result) == 10 +@pytest.mark.filterwarnings("ignore") @pytest.mark.integration def test_ray_nan(table_test_null_nan_rewritten: Table) -> None: ray_dataset = table_test_null_nan_rewritten.scan().to_ray() diff --git a/tests/utils/test_manifest.py b/tests/utils/test_manifest.py index 4d55610c74..08906b68ad 100644 --- a/tests/utils/test_manifest.py +++ b/tests/utils/test_manifest.py @@ -343,8 +343,8 @@ def test_write_manifest( writer.add_entry(manifest_entries[0]) expected_metadata = { - "schema": test_schema.json(), - "partition-spec": test_spec.json(), + "schema": test_schema.model_dump_json(), + "partition-spec": test_spec.model_dump_json(), "partition-spec-id": str(test_spec.spec_id), "format-version": str(format_version), }