Skip to content

Using @model_validator with mode='after' on a classmethod is deprecated #382

@cclauss

Description

@cclauss

This Pydantic warning is raised during our pytest runs on GitHub Actions CI.

@model_validator(mode="after")
@classmethod
def _check_entries(cls, values): # noqa: B902

.nox/tests-3-11/lib/python3.11/site-packages/parasect/_helpers.py:290
  /Users/runner/work/parasect/parasect/.nox/tests-3-11/lib/python3.11/site-packages/parasect/_helpers.py:290:
    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.
      @model_validator(mode="after")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions