@@ -37,7 +37,7 @@ class BasicTypesModel(BaseModel):
37
37
bytes_field : bytes
38
38
none_field : None
39
39
40
- def _check_instance (self ):
40
+ def _check_instance (self ) -> None :
41
41
assert isinstance (self .int_field , int )
42
42
assert isinstance (self .float_field , float )
43
43
assert isinstance (self .str_field , str )
@@ -70,7 +70,7 @@ class ComplexTypesModel(BaseModel):
70
70
union_field : Union [str , int ]
71
71
optional_field : Optional [str ]
72
72
73
- def _check_instance (self ):
73
+ def _check_instance (self ) -> None :
74
74
assert isinstance (self .list_field , list )
75
75
assert isinstance (self .dict_field , dict )
76
76
assert isinstance (self .set_field , set )
@@ -104,7 +104,7 @@ class SpecialTypesModel(BaseModel):
104
104
uuid_field : uuid .UUID
105
105
ip_field : IPv4Address
106
106
107
- def _check_instance (self ):
107
+ def _check_instance (self ) -> None :
108
108
assert isinstance (self .datetime_field , datetime )
109
109
assert isinstance (self .date_field , date )
110
110
assert isinstance (self .timedelta_field , timedelta )
@@ -139,7 +139,7 @@ class ParentModel(BaseModel):
139
139
child : ChildModel
140
140
children : List [ChildModel ]
141
141
142
- def _check_instance (self ):
142
+ def _check_instance (self ) -> None :
143
143
assert isinstance (self .child , ChildModel )
144
144
assert isinstance (self .children , list )
145
145
assert all (isinstance (child , ChildModel ) for child in self .children )
@@ -170,7 +170,7 @@ class FieldFeaturesModel(BaseModel):
170
170
field_with_constraints : int = Field (gt = 0 , lt = 100 )
171
171
field_with_alias : str = Field (alias = "different_name" )
172
172
173
- def _check_instance (self ):
173
+ def _check_instance (self ) -> None :
174
174
assert isinstance (self .field_with_default , str )
175
175
assert isinstance (self .field_with_factory , datetime )
176
176
assert isinstance (self .field_with_constraints , int )
@@ -191,7 +191,7 @@ class AnnotatedFieldsModel(BaseModel):
191
191
max_length_str : Annotated [str , Len (max_length = 10 )]
192
192
custom_json : Annotated [Dict [str , Any ], WithJsonSchema ({"extra" : "data" })]
193
193
194
- def _check_instance (self ):
194
+ def _check_instance (self ) -> None :
195
195
assert isinstance (self .max_length_str , str )
196
196
assert isinstance (self .custom_json , dict )
197
197
assert len (self .max_length_str ) <= 10
@@ -213,7 +213,7 @@ class GenericModel(BaseModel, Generic[T]):
213
213
value : T
214
214
values : List [T ]
215
215
216
- def _check_instance (self ):
216
+ def _check_instance (self ) -> None :
217
217
assert isinstance (self .value , str )
218
218
assert isinstance (self .values , list )
219
219
assert all (isinstance (v , str ) for v in self .values )
@@ -367,7 +367,7 @@ def make_pydantic_timedelta_object() -> PydanticTimedeltaModel:
367
367
ParentModel ,
368
368
FieldFeaturesModel ,
369
369
AnnotatedFieldsModel ,
370
- GenericModel ,
370
+ GenericModel [ Any ] ,
371
371
PydanticDatetimeModel ,
372
372
PydanticDateModel ,
373
373
PydanticTimedeltaModel ,
@@ -410,8 +410,8 @@ def make_heterogeneous_list_of_pydantic_objects() -> List[PydanticModels]:
410
410
make_pydantic_timedelta_object (),
411
411
]
412
412
for o in objects :
413
- o ._check_instance ()
414
- return objects
413
+ o ._check_instance () # type: ignore
414
+ return objects # type: ignore
415
415
416
416
417
417
@activity .defn
0 commit comments