Skip to content

Feature: 添加 pydantic validator 兼容函数 #1337

Feature: 添加 pydantic validator 兼容函数

Feature: 添加 pydantic validator 兼容函数 #1337

Triggered via pull request January 31, 2025 15:28
Status Failure
Total duration 35s
Artifacts

pyright.yml

on: pull_request
Matrix: Pyright Lint
Fit to window
Zoom out
Zoom in

Annotations

5 errors
Pyright Lint (pydantic-v2): tests/test_compat.py#L55
Argument of type "Literal[123]" cannot be assigned to parameter "bar" of type "str" in function "__init__"   "Literal[123]" is not assignable to "str" (reportArgumentType)
Pyright Lint (pydantic-v2): tests/test_compat.py#L97
Argument of type "(self: Self@TestModel) -> None" cannot be assigned to parameter of type "_AnyModelAfterValidator[_ModelType@model_validator]"   Type "(self: Self@TestModel) -> None" is not assignable to type "_AnyModelAfterValidator[_ModelType@model_validator]"     Type "(self: Self@TestModel) -> None" is not assignable to type "ModelAfterValidator[_ModelType@model_validator]"       Function accepts too many positional parameters; expected 1 but received 2         Function return type "None" is incompatible with type "_ModelType@model_validator"           Type "None" is not assignable to type "Self@TestModel"     Type "(self: Self@TestModel) -> None" is not assignable to type "ModelAfterValidatorWithoutInfo[_ModelType@model_validator]"       Function return type "None" is incompatible with type "_ModelType@model_validator"         Type "None" is not assignable to type "Self@TestModel" (reportArgumentType)
Pyright Lint (pydantic-v2)
2 errors
Pyright Lint (pydantic-v1): tests/test_compat.py#L55
Argument of type "Literal[123]" cannot be assigned to parameter "bar" of type "str" in function "__init__"   "Literal[123]" is not assignable to "str" (reportArgumentType)
Pyright Lint (pydantic-v1)
1 error