Skip to content

Commit acb522f

Browse files
committed
Refactor ConfiguredBaseModel for pydantic
1 parent 914bdde commit acb522f

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

tests/test_loaders_dumpers/models/books_normalized_pydantic.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@
1212
class WeakRefShimBaseModel(BaseModel):
1313
__slots__ = '__weakref__'
1414

15-
class ConfiguredBaseModel(WeakRefShimBaseModel,
16-
validate_assignment = True,
17-
validate_all = True,
18-
underscore_attrs_are_private = True,
19-
extra = 'forbid',
20-
arbitrary_types_allowed = True,
21-
use_enum_values = True):
22-
pass
15+
class ConfiguredBaseModel(WeakRefShimBaseModel):
16+
validate_assignment: bool = True
17+
validate_all: bool = True
18+
underscore_attrs_are_private: bool = True
19+
extra: str = 'forbid'
20+
arbitrary_types_allowed: bool = True
21+
use_enum_values: bool = True
2322

2423

2524
class GenreEnum(str, Enum):

tests/test_loaders_dumpers/models/kitchen_sink_pydantic.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@
1212
class WeakRefShimBaseModel(BaseModel):
1313
__slots__ = '__weakref__'
1414

15-
class ConfiguredBaseModel(WeakRefShimBaseModel,
16-
validate_assignment = True,
17-
validate_all = True,
18-
underscore_attrs_are_private = True,
19-
extra = 'forbid',
20-
arbitrary_types_allowed = True,
21-
use_enum_values = True):
22-
pass
15+
class ConfiguredBaseModel(WeakRefShimBaseModel):
16+
validate_assignment: bool = True
17+
validate_all: bool = True
18+
underscore_attrs_are_private: bool = True
19+
extra: str = 'forbid'
20+
arbitrary_types_allowed: bool = True
21+
use_enum_values: bool = True
2322

2423

2524
class FamilialRelationshipType(str, Enum):

0 commit comments

Comments
 (0)