[jsonschema] Improve stubs
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉
Diff from mypy_primer, showing the effect of this PR on open source code:
cloud-init (https://github.com/canonical/cloud-init)
+ cloudinit/config/schema.py:475: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, Any, Any, type[Exception]], Any]", target has type "SchemaKeywordValidator") [assignment]
+ cloudinit/config/schema.py:475: note: "SchemaKeywordValidator.__call__" has type "Callable[[Arg(Validator, 'validator'), Arg(Any, 'value'), Arg(Any, 'instance'), Arg(bool | Mapping[str, Any], 'schema')], None]"
+ cloudinit/config/schema.py:476: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, Any, Any, type[Exception]], Any]", target has type "SchemaKeywordValidator") [assignment]
+ cloudinit/config/schema.py:476: note: "SchemaKeywordValidator.__call__" has type "Callable[[Arg(Validator, 'validator'), Arg(Any, 'value'), Arg(Any, 'instance'), Arg(bool | Mapping[str, Any], 'schema')], None]"
+ cloudinit/config/schema.py:480: error: Argument "validators" to "create" has incompatible type "dict[str, SchemaKeywordValidator]"; expected "Mapping[str, Callable[[Any, Any, Mapping[str, Any] | list[Any] | str | int | float | bool | None, Mapping[str, Any]], Iterator[ValidationError]]] | tuple[()]" [arg-type]
+ cloudinit/config/schema.py:482: error: Argument 4 to "create" has incompatible type "**dict[str, TypeChecker]"; expected "FormatChecker" [arg-type]
+ cloudinit/config/schema.py:482: error: Argument 4 to "create" has incompatible type "**dict[str, TypeChecker]"; expected "Callable[[bool | Mapping[str, Any]], str]" [arg-type]
+ cloudinit/config/schema.py:482: error: Argument 4 to "create" has incompatible type "**dict[str, TypeChecker]"; expected "Callable[[bool | Mapping[str, Any]], Iterable[tuple[str, Callable[[Any, Any, Mapping[str, Any] | list[Any] | str | int | float | bool | None, Mapping[str, Any]], Iterator[ValidationError]]]]]" [arg-type]
prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/utilities/schema_tools/validation.py:43: error: Dict entry 0 has incompatible type "str": "Callable[[_Validator, object, Any, Any], Iterator[ValidationError]]"; expected "str": "SchemaKeywordValidator" [dict-item]
+ src/prefect/utilities/schema_tools/validation.py:51: error: Argument "validators" to "create" has incompatible type "dict[str, SchemaKeywordValidator]"; expected "Union[Mapping[str, Callable[[Any, Any, Union[Mapping[str, Any], list[Any], str, int, float, bool, None], Mapping[str, Any]], Iterator[ValidationError]]], tuple[()]]" [arg-type]
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉