Skip to content

Commit 65573c1

Browse files
committed
fix emtpy annotaitons prettification
1 parent faab9d3 commit 65573c1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/superannotate/lib/core/usecases/annotations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ def _prettify_annotations(self, annotations: List[dict]):
781781
for annotation in annotations:
782782
restruct[annotation["metadata"]["name"]] = annotation
783783
try:
784-
return [restruct[x] for x in self._item_names]
784+
return [restruct[x] for x in self._item_names if x in restruct]
785785
except KeyError:
786786
raise AppException("Broken data.")
787787

tests/integration/folders/test_folders.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ def test_project_completed_count(self):
234234
project, self.folder_path, annotation_status="Completed"
235235
)
236236
project_metadata = sa.get_project_metadata(self.PROJECT_NAME, include_complete_image_count=True)
237-
self.assertEqual(project_metadata['completedImagesCount'], 8)
238-
self.assertEqual(project_metadata['rootFolderCompletedImagesCount'], 4)
237+
self.assertEqual(project_metadata['completed_images_count'], 8)
238+
self.assertEqual(project_metadata['root_folder_completed_images_count'], 4)
239239

240240
def test_folder_misnamed(self):
241241

tests/integration/test_interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def test_search_project(self):
9797
sa.upload_images_from_folder_to_project(self.PROJECT_NAME, self.folder_path)
9898
sa.set_annotation_statuses(self.PROJECT_NAME, "Completed", [self.EXAMPLE_IMAGE_1])
9999
data = sa.search_projects(self.PROJECT_NAME, return_metadata=True, include_complete_image_count=True)
100-
self.assertIsNotNone(data[0]['completedImagesCount'])
100+
self.assertIsNotNone(data[0]['completed_images_count'])
101101

102102
def test_overlay_fuse(self):
103103
sa.upload_image_to_project(self.PROJECT_NAME, f"{self.folder_path}/{self.EXAMPLE_IMAGE_1}")

0 commit comments

Comments
 (0)