Skip to content

Upstream Pydantic 2.12.0 has a Regression that will break PyIceberg #2590

@HonahX

Description

@HonahX

Apache Iceberg version

None

Please describe the bug 🐞

Pydantic recently 2.12.0 and unfortunately it contains a regression: pydantic/pydantic#12347 that ValidationInfo object will lose field_names in some cases.

I have a draft PR that experiments 2.12.0 and confirmed that the regression affect us: #2589


table_metadata = ValidationInfo(config={'title': 'TableMetadataV2', 'validate_by_alias': True, 'validate_by_name': True}, context=None, data=None, field_name=None)

    def check_schemas(table_metadata: TableMetadata) -> TableMetadata:
        """Check if the current-schema-id is actually present in schemas."""
>       current_schema_id = table_metadata.current_schema_id
E       AttributeError: 'pydantic_core._pydantic_core.ValidationInfo' object has no attribute 'current_schema_id'

More info:
pydantic 2.11.10

Image

pydantic 2.12.0

Image

While waiting for upstream fix, I think we may want to pin the pydantic version to <2.12.0

Willingness to contribute

  • I can contribute a fix for this bug independently
  • I would be willing to contribute a fix for this bug with guidance from the Iceberg community
  • I cannot contribute a fix for this bug at this time

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions