Skip to content

Commit

Permalink
fix: Ensure that we actually force parse to UUID (#814)
Browse files Browse the repository at this point in the history
* fix: Ensure that we actually force parse to UUID
  • Loading branch information
Jim-Encord authored Dec 4, 2024
1 parent 22101f3 commit 8811495
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion encord/objects/ontology_labels_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2049,7 +2049,7 @@ def _parse_label_row_dict(self, label_row_dict: dict) -> LabelRowReadOnlyData:
images_data=label_row_dict.get("images_data", self._label_row_read_only_data.images_data),
file_type=label_row_dict.get("file_type", None),
is_valid=bool(label_row_dict.get("is_valid", True)),
backing_item_uuid=label_row_dict.get("backing_item_uuid", self.backing_item_uuid),
backing_item_uuid=self.backing_item_uuid,
)

def _parse_labels_from_dict(self, label_row_dict: dict):
Expand Down
6 changes: 4 additions & 2 deletions encord/orm/label_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def from_dict(cls, json_dict: Dict) -> LabelRowMetadata:

annotation_task_status = (
AnnotationTaskStatus(json_dict["annotation_task_status"])
if json_dict["annotation_task_status"] is not None
if json_dict.get("annotation_task_status", None) is not None
else None
)

Expand Down Expand Up @@ -338,7 +338,9 @@ def from_dict(cls, json_dict: Dict) -> LabelRowMetadata:
file_type=json_dict.get("file_type"),
is_valid=bool(json_dict.get("is_valid", True)),
branch_name=json_dict["branch_name"],
backing_item_uuid=json_dict.get("backing_item_uuid", None),
backing_item_uuid=UUID(json_dict["backing_item_uuid"])
if json_dict.get("backing_item_uuid", None) is not None
else None,
)

@classmethod
Expand Down

0 comments on commit 8811495

Please sign in to comment.