Skip to content

Reusable validators cause untyped field mypy error #3146

@Dreamsorcerer

Description

@Dreamsorcerer

Using the example for reusable validators, if the plugin's warn_untyped_fields is enabled, then I get this error when checking the example:

test.py:12: error: Untyped fields disallowed  [pydantic-field]
test.py:19: error: Untyped fields disallowed  [pydantic-field]

https://pydantic-docs.helpmanual.io/usage/validators/#reuse-validators

Expected behaviour:
There should be no errors. The attribute should be inferred as a validator and no error should be raised.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug V1Bug related to Pydantic V1.X

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions