@@ -107,10 +107,10 @@ def log_report(
107107
108108class ItemToUpload (BaseModel ):
109109 item : BaseItemEntity
110- annotation_json : Optional [dict ]
111- path : Optional [str ]
112- file_size : Optional [int ]
113- mask : Optional [io .BytesIO ]
110+ annotation_json : Optional [dict ] = None
111+ path : Optional [str ] = None
112+ file_size : Optional [int ] = None
113+ mask : Optional [io .BytesIO ] = None
114114
115115 class Config :
116116 arbitrary_types_allowed = True
@@ -282,12 +282,12 @@ def validate_project_type(self):
282282 raise AppException ("Unsupported project type." )
283283
284284 def _validate_json (self , json_data : dict ) -> list :
285- if self ._project .type >= constants .ProjectType .PIXEL . value :
285+ if self ._project .type >= int ( constants .ProjectType .PIXEL ) :
286286 return []
287287 use_case = ValidateAnnotationUseCase (
288288 reporter = self .reporter ,
289289 team_id = self ._project .team_id ,
290- project_type = self ._project .type . value ,
290+ project_type = self ._project .type ,
291291 annotation = json_data ,
292292 service_provider = self ._service_provider ,
293293 )
@@ -2103,8 +2103,7 @@ def execute(self):
21032103 for item_name in uploaded_annotations :
21042104 category = (
21052105 name_annotation_map [item_name ]["metadata" ]
2106- .get ("item_category" , {})
2107- .get ("value" )
2106+ .get ("item_category" , None )
21082107 )
21092108 if category :
21102109 item_id_category_map [name_item_map [item_name ].id ] = category
0 commit comments