Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/superannotate/lib/core/usecases/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ def validate_item_names(self):
f"Dropping duplicates. Found {len_unique_items}/{len_items} unique items."
)
self._item_names = item_names
else:
elif self._item_names is None:
self._item_names_provided = False
condition = Condition("project_id", self._project.id, EQ) & Condition(
"folder_id", self._folder.id, EQ
Expand All @@ -1014,6 +1014,8 @@ def validate_item_names(self):
self._item_names = [
item.name for item in self._service_provider.items.list(condition).data
]
else:
self._item_names = []

def _prettify_annotations(self, annotations: List[dict]):
re_struct = {}
Expand Down
10 changes: 10 additions & 0 deletions tests/integration/annotations/test_get_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,13 @@ def test_video_annotation_upload_folder(self):
sa.upload_annotations_from_folder_to_project(path, self.annotations_path)
annotations = sa.get_annotations(path)
self.assertEqual(len(annotations), 2)

def test_empty_list_get(self):
_, _, _ = sa.attach_items(
self.PROJECT_NAME,
self.csv_path,
)
annotations = sa.get_annotations(self.PROJECT_NAME, items=[])
assert len(annotations) == 0
annotations = sa.get_annotations(self.PROJECT_NAME, items=None)
assert len(annotations) == 2