Skip to content

Commit 9085a66

Browse files
authored
Update pydantic_compat.py
1 parent be31363 commit 9085a66

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

libs/labelbox/src/labelbox/pydantic_compat.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,3 @@ def pydantic_import(class_name, sub_module_path: Optional[str] = None):
3232
conlist = pydantic_import("conlist")
3333
constr = pydantic_import("constr")
3434
confloat = pydantic_import("confloat")
35-
36-
def feature_serializer(res: Dict) -> Dict:
37-
"""Used as a with custom model serializer for pydantics. This ensures backwards compatibility since pydantic V1 allowed you to override Dict method. This method needs to be used for all base classes and sub classes. We should look at getting this removed."""
38-
if "customMetrics" in res and res["customMetrics"] is None:
39-
res.pop("customMetrics")
40-
if "custom_metrics" in res and res["custom_metrics"] is None:
41-
res.pop("custom_metrics")
42-
if "keyframe" in res and res["keyframe"] == None:
43-
res.pop("keyframe")
44-
if "classifications" in res and res["classifications"] == []:
45-
res.pop("classifications")
46-
if "confidence" in res and res["confidence"] is None:
47-
res.pop("confidence")
48-
if 'name' in res and res['name'] is None:
49-
res.pop('name')
50-
if 'featureSchemaId' in res and res['featureSchemaId'] is None:
51-
res.pop('featureSchemaId')
52-
53-
return res
54-

0 commit comments

Comments
 (0)