This commit is contained in:
Iliyan Angelov
2025-12-01 06:50:10 +02:00
parent 91f51bc6fe
commit 62c1fe5951
4682 changed files with 544807 additions and 31208 deletions

View File

@@ -22,7 +22,7 @@ class Protocol(str, Enum):
pickle = 'pickle'
@deprecated('load_str_bytes is deprecated.', category=PydanticDeprecatedSince20)
@deprecated('`load_str_bytes` is deprecated.', category=None)
def load_str_bytes(
b: str | bytes,
*,
@@ -32,7 +32,7 @@ def load_str_bytes(
allow_pickle: bool = False,
json_loads: Callable[[str], Any] = json.loads,
) -> Any:
warnings.warn('load_str_bytes is deprecated.', DeprecationWarning, stacklevel=2)
warnings.warn('`load_str_bytes` is deprecated.', category=PydanticDeprecatedSince20, stacklevel=2)
if proto is None and content_type:
if content_type.endswith(('json', 'javascript')):
pass
@@ -56,7 +56,7 @@ def load_str_bytes(
raise TypeError(f'Unknown protocol: {proto}')
@deprecated('load_file is deprecated.', category=PydanticDeprecatedSince20)
@deprecated('`load_file` is deprecated.', category=None)
def load_file(
path: str | Path,
*,
@@ -66,7 +66,7 @@ def load_file(
allow_pickle: bool = False,
json_loads: Callable[[str], Any] = json.loads,
) -> Any:
warnings.warn('load_file is deprecated.', DeprecationWarning, stacklevel=2)
warnings.warn('`load_file` is deprecated.', category=PydanticDeprecatedSince20, stacklevel=2)
path = Path(path)
b = path.read_bytes()
if content_type is None: