chore: Switch to pydantic.ConfigDict in typing_validations.py (#22268)

> PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.0/migration/
This commit is contained in:
Corentin Flr 2023-09-02 07:53:50 +02:00 committed by GitHub
parent f88df82820
commit 1380241609
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,8 @@ from inspect import _empty, isclass, signature
from types import EllipsisType from types import EllipsisType
from typing import ForwardRef, TypeVar, Union from typing import ForwardRef, TypeVar, Union
from pydantic import ConfigDict
from frappe.exceptions import FrappeTypeError from frappe.exceptions import FrappeTypeError
SLACK_DICT = { SLACK_DICT = {
@ -12,8 +14,7 @@ SLACK_DICT = {
T = TypeVar("T") T = TypeVar("T")
class FrappePydanticConfig: FrappePydanticConfig = ConfigDict(arbitrary_types_allowed=True)
arbitrary_types_allowed = True
def validate_argument_types(func: Callable, apply_condition: Callable = lambda: True): def validate_argument_types(func: Callable, apply_condition: Callable = lambda: True):