This commit is contained in:
@@ -1,9 +1,18 @@
|
||||
"""Pydantic-specific warnings."""
|
||||
|
||||
from __future__ import annotations as _annotations
|
||||
|
||||
from .version import version_short
|
||||
|
||||
__all__ = 'PydanticDeprecatedSince20', 'PydanticDeprecationWarning'
|
||||
__all__ = (
|
||||
'PydanticDeprecatedSince20',
|
||||
'PydanticDeprecatedSince26',
|
||||
'PydanticDeprecatedSince29',
|
||||
'PydanticDeprecatedSince210',
|
||||
'PydanticDeprecatedSince211',
|
||||
'PydanticDeprecationWarning',
|
||||
'PydanticExperimentalWarning',
|
||||
)
|
||||
|
||||
|
||||
class PydanticDeprecationWarning(DeprecationWarning):
|
||||
@@ -45,3 +54,43 @@ class PydanticDeprecatedSince20(PydanticDeprecationWarning):
|
||||
|
||||
def __init__(self, message: str, *args: object) -> None:
|
||||
super().__init__(message, *args, since=(2, 0), expected_removal=(3, 0))
|
||||
|
||||
|
||||
class PydanticDeprecatedSince26(PydanticDeprecationWarning):
|
||||
"""A specific `PydanticDeprecationWarning` subclass defining functionality deprecated since Pydantic 2.6."""
|
||||
|
||||
def __init__(self, message: str, *args: object) -> None:
|
||||
super().__init__(message, *args, since=(2, 6), expected_removal=(3, 0))
|
||||
|
||||
|
||||
class PydanticDeprecatedSince29(PydanticDeprecationWarning):
|
||||
"""A specific `PydanticDeprecationWarning` subclass defining functionality deprecated since Pydantic 2.9."""
|
||||
|
||||
def __init__(self, message: str, *args: object) -> None:
|
||||
super().__init__(message, *args, since=(2, 9), expected_removal=(3, 0))
|
||||
|
||||
|
||||
class PydanticDeprecatedSince210(PydanticDeprecationWarning):
|
||||
"""A specific `PydanticDeprecationWarning` subclass defining functionality deprecated since Pydantic 2.10."""
|
||||
|
||||
def __init__(self, message: str, *args: object) -> None:
|
||||
super().__init__(message, *args, since=(2, 10), expected_removal=(3, 0))
|
||||
|
||||
|
||||
class PydanticDeprecatedSince211(PydanticDeprecationWarning):
|
||||
"""A specific `PydanticDeprecationWarning` subclass defining functionality deprecated since Pydantic 2.11."""
|
||||
|
||||
def __init__(self, message: str, *args: object) -> None:
|
||||
super().__init__(message, *args, since=(2, 11), expected_removal=(3, 0))
|
||||
|
||||
|
||||
class GenericBeforeBaseModelWarning(Warning):
|
||||
pass
|
||||
|
||||
|
||||
class PydanticExperimentalWarning(Warning):
|
||||
"""A Pydantic specific experimental functionality warning.
|
||||
|
||||
This warning is raised when using experimental functionality in Pydantic.
|
||||
It is raised to warn users that the functionality may change or be removed in future versions of Pydantic.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user