File tree Expand file tree Collapse file tree 1 file changed +1
-9
lines changed
Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Original file line number Diff line number Diff line change 33from typing import Any , Dict , Optional
44
55from pydantic import BaseModel , StrictStr
6- from pydantic .version import VERSION as PYDANTIC_VERSION
76
87logger = logging .getLogger (__name__ )
98
10- PYDANTIC_VERSION_MINOR_TUPLE = tuple (int (x ) for x in PYDANTIC_VERSION .split ("." )[:2 ])
11- PYDANTIC_V2 = PYDANTIC_VERSION_MINOR_TUPLE [0 ] == 2
12-
139
1410class FastAPIConfig (BaseModel ):
1511 entrypoint : Optional [StrictStr ] = None
@@ -43,8 +39,4 @@ def resolve(cls, entrypoint: Optional[str] = None) -> "FastAPIConfig":
4339 if entrypoint is not None :
4440 config ["entrypoint" ] = entrypoint
4541
46- # Pydantic v2 uses model_validate, v1 uses parse_obj
47- if not PYDANTIC_V2 :
48- return cls .parse_obj (config ) # type: ignore[no-any-return, unused-ignore]
49-
50- return cls .model_validate (config ) # type: ignore[no-any-return, unused-ignore, attr-defined]
42+ return cls .model_validate (config )
You can’t perform that action at this time.
0 commit comments