File tree Expand file tree Collapse file tree 3 files changed +16
-15
lines changed
src/superannotate/lib/core Expand file tree Collapse file tree 3 files changed +16
-15
lines changed Original file line number Diff line number Diff line change 88from pydantic import constr
99from pydantic import EmailStr
1010from pydantic import Field
11+ from pydantic import Extra
1112from pydantic import validator
1213from pydantic .errors import EnumMemberError
1314
@@ -29,7 +30,7 @@ def enum_error_handling(self) -> str:
2930class BaseModel (PyDanticBaseModel ):
3031
3132 class Config :
32- # extra = "forbid"
33+ extra = Extra . allow
3334 use_enum_values = True
3435 error_msg_templates = {
3536 "type_error.integer" : "integer type expected" ,
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class BaseValidator(metaclass=ABCMeta):
1414 def __init__ (self , data : Any , allow_extra : bool = True ):
1515 self .data = data
1616 self ._validation_output = None
17- self ._extra = Extra .ignore if allow_extra else Extra .forbid
17+ self ._extra = Extra .allow if allow_extra else Extra .forbid
1818
1919 @classmethod
2020 def validate (cls , data : Any , extra = True ):
Original file line number Diff line number Diff line change @@ -112,11 +112,11 @@ class TestTypeHandling(TestCase):
112112 "width": 1024,
113113 "height": 683,
114114 "status": "Completed",
115- "pinned": False ,
116- "isPredicted": None ,
117- "projectId": None ,
118- "annotatorEmail": None ,
119- "qaEmail": None
115+ "pinned": false ,
116+ "isPredicted": null ,
117+ "projectId": null ,
118+ "annotatorEmail": null ,
119+ "qaEmail": null
120120 },
121121 "instances": [
122122 {
@@ -131,8 +131,8 @@ class TestTypeHandling(TestCase):
131131 },
132132 "groupId": 0,
133133 "pointLabels": {},
134- "locked": False ,
135- "visible": False ,
134+ "locked": false ,
135+ "visible": false ,
136136 "attributes": [
137137 {
138138 "id": 117845,
@@ -142,12 +142,12 @@ class TestTypeHandling(TestCase):
142142 }
143143 ],
144144 "trackingId": "aaa97f80c9e54a5f2dc2e920fc92e5033d9af45b",
145- "error": None ,
146- "createdAt": None ,
147- "createdBy": None ,
148- "creationType": None ,
149- "updatedAt": None ,
150- "updatedBy": None ,
145+ "error": null ,
146+ "createdAt": null ,
147+ "createdBy": null ,
148+ "creationType": null ,
149+ "updatedAt": null ,
150+ "updatedBy": null ,
151151 "className": "Personal vehicle"
152152 }
153153 ]
You can’t perform that action at this time.
0 commit comments