use pydantic version instead

This commit is contained in:
India Kerle 2024-03-07 10:56:27 -03:00
parent 52342fc741
commit 7abfb4e3e8
1 changed files with 3 additions and 2 deletions

View File

@ -1,11 +1,12 @@
import re import re
from typing import Callable, List, Optional, Union from typing import Callable, List, Optional, Union
import pydantic
from pydantic import BaseModel from pydantic import BaseModel
try: if pydantic.VERSION.split(".")[0] == "1": # type: ignore
from pydantic import validator # type: ignore from pydantic import validator # type: ignore
except ImportError: else:
from pydantic import field_validator as validator # type: ignore from pydantic import field_validator as validator # type: ignore
from ..language import Language from ..language import Language