diff --git a/sqlmodel/_compat.py b/sqlmodel/_compat.py index 989c09e1c7..d6b98aaca7 100644 --- a/sqlmodel/_compat.py +++ b/sqlmodel/_compat.py @@ -25,8 +25,8 @@ # Reassign variable to make it reexported for mypy PYDANTIC_VERSION = P_VERSION -PYDANTIC_MINOR_VERSION = tuple(int(i) for i in P_VERSION.split(".", 2)[:2]) -IS_PYDANTIC_V2 = PYDANTIC_MINOR_VERSION[0] >= 2 +PYDANTIC_MINOR_VERSION = tuple(int(i) for i in P_VERSION.split(".")[:2]) +IS_PYDANTIC_V2 = PYDANTIC_MINOR_VERSION[0] == 2 if TYPE_CHECKING: