Skip to content

Pydantic failing py unit tests #24929

@JasonLi314

Description

@JasonLi314

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

basic make test fails cd py-polars && make test

___________________________________________ ERROR collecting tests/unit/io/test_iceberg.py ____________________________________________
tests/unit/io/test_iceberg.py:19: in <module>
    from pyiceberg.catalog.sql import SqlCatalog
../.venv/lib/python3.13/site-packages/pyiceberg/catalog/__init__.py:52: in <module>
    from pyiceberg.serializers import ToOutputFile
../.venv/lib/python3.13/site-packages/pyiceberg/serializers.py:25: in <module>
    from pyiceberg.table.metadata import TableMetadata, TableMetadataUtil
../.venv/lib/python3.13/site-packages/pyiceberg/table/__init__.py:84: in <module>
    from pyiceberg.table.metadata import (
../.venv/lib/python3.13/site-packages/pyiceberg/table/metadata.py:347: in <module>
    class TableMetadataV1(TableMetadataCommonFields, IcebergBaseModel):
../.venv/lib/python3.13/site-packages/pyiceberg/table/metadata.py:365: in TableMetadataV1
    @model_validator(mode="after")
../.venv/lib/python3.13/site-packages/pydantic/functional_validators.py:725: in dec
    warnings.warn(
E   pydantic.warnings.PydanticDeprecatedSince212: Using `@model_validator` with mode='after' on a classmethod is deprecated. Instead, use an instance method. See the documentation at https://docs.pydantic.dev/2.12/concepts/validators/#model-after-validator. Deprecated in Pydantic V2.12 to be removed in V3.0.

Error report:

======================================================= short test summary info =======================================================
ERROR tests/unit/io/test_iceberg.py - pydantic.warnings.PydanticDeprecatedSince212: Using `@model_validator` with mode='after' on a classmethod is deprecated. Instead, ...
ERROR tests/unit/io/test_iceberg.py - pydantic.warnings.PydanticDeprecatedSince212: Using `@model_validator` with mode='after' on a classmethod is deprecated. Instead, ...
ERROR tests/unit/io/test_iceberg.py - pydantic.warnings.PydanticDeprecatedSince212: Using `@model_validator` with mode='after' on a classmethod is deprecated. Instead, ...
ERROR tests/unit/io/test_iceberg.py - pydantic.warnings.PydanticDeprecatedSince212: Using `@model_validator` with mode='after' on a classmethod is deprecated. Instead, ...
ERROR tests/unit/io/test_iceberg.py - pydantic.warnings.PydanticDeprecatedSince212: Using `@model_validator` with mode='after' on a classmethod is deprecated. Instead, ...
ERROR tests/unit/io/test_iceberg.py - pydantic.warnings.PydanticDeprecatedSince212: Using `@model_validator` with mode='after' on a classmethod is deprecated. Instead, ...
ERROR tests/unit/io/test_iceberg.py - pydantic.warnings.PydanticDeprecatedSince212: Using `@model_validator` with mode='after' on a classmethod is deprecated. Instead, ...
ERROR tests/unit/io/test_iceberg.py - pydantic.warnings.PydanticDeprecatedSince212: Using `@model_validator` with mode='after' on a classmethod is deprecated. Instead, ...
ERROR tests/unit/io/test_iceberg.py - pydantic.warnings.PydanticDeprecatedSince212: Using `@model_validator` with mode='after' on a classmethod is deprecated. Instead, ...
ERROR tests/unit/io/test_iceberg.py - pydantic.warnings.PydanticDeprecatedSince212: Using `@model_validator` with mode='after' on a classmethod is deprecated. Instead, ...
======================================= 14340 passed, 9 skipped, 9 xfailed, 10 errors in 32.87s =======================================

reproduced issue on main branch and most recent release py-1.34.0

Log output

Issue description

pyiceberg is breaking polars unit test due to most recent pydantic release.

Expected behavior

pass local unit test

Installed versions

--------Version info---------
Polars:              1.34.0
Index type:          UInt32
Platform:            macOS-15.6.1-arm64-arm-64bit-Mach-O
Python:              3.13.2 (main, Feb  4 2025, 14:51:09) [Clang 16.0.0 (clang-1600.0.26.6)]
Runtime:             unknown

----Optional dependencies----
Azure CLI            <not installed>
adbc_driver_manager  1.8.0
altair               5.5.0
azure.identity       1.25.1
boto3                1.40.49
cloudpickle          3.1.1
connectorx           0.4.4
deltalake            1.2.0
fastexcel            0.16.0
fsspec               2025.9.0
gevent               25.9.1
google.auth          2.41.1
great_tables         0.19.0
matplotlib           3.10.7
numpy                2.3.4
openpyxl             3.1.5
pandas               2.3.3
...
sqlalchemy           2.0.44
torch                <not installed>
xlsx2csv             0.8.4
xlsxwriter           3.2.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triageAwaiting prioritization by a maintainerpythonRelated to Python Polars

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions