♻️ Refactor types to properly support Pydantic 2.7 (#913)

This commit is contained in:
Sebastián Ramírez
2024-04-29 15:11:02 -07:00
committed by GitHub
parent 6151f23e15
commit 2454694de3
2 changed files with 22 additions and 2 deletions

View File

@@ -18,11 +18,13 @@ from typing import (
Union,
)
from pydantic import VERSION as PYDANTIC_VERSION
from pydantic import VERSION as P_VERSION
from pydantic import BaseModel
from pydantic.fields import FieldInfo
from typing_extensions import get_args, get_origin
# Reassign variable to make it reexported for mypy
PYDANTIC_VERSION = P_VERSION
IS_PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.")