-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Breaking: Update to pydantic 2 (#131)
* Update to pydantic 2 * fix process tests * field->Field * Extra inputs not permitted * Update error messages in tests * Update base model to pydantic 2. fix linter errors * Temporarily disable mypy tests. * fix python versions in test yaml * wait with 3.12
- Loading branch information
1 parent
8bee24f
commit ef6f816
Showing
25 changed files
with
349 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
from decimal import Decimal | ||
from typing import Union | ||
|
||
from pydantic import BaseModel, Extra | ||
from pydantic import BaseModel, ConfigDict | ||
from pydantic.types import StrictBool, StrictInt, StrictStr | ||
|
||
AnyType = Union[StrictStr, StrictInt, StrictBool, Decimal, list, dict] | ||
StrInt = Union[StrictStr, StrictInt] | ||
|
||
|
||
class KaibaBaseModel(BaseModel): | ||
"""Allows for iterating lists at given path.""" | ||
"""Base model that forbids non defined attributes.""" | ||
|
||
class Config(object): | ||
"""Make sure any unexpected attributes in config cause error.""" | ||
|
||
extra = Extra.forbid | ||
model_config = ConfigDict(extra='forbid') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.