Skip to content

Commit 35b0846

Browse files
authored
Merge branch 'develop' into sdk_core_integration
2 parents 6c2baee + fba2fc0 commit 35b0846

File tree

6 files changed

+42
-9
lines changed

6 files changed

+42
-9
lines changed

CHANGELOG.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ History
66

77
All release highlights of this project will be documented in this file.
88

9+
4.4.21 - May 23, 2024
10+
_______________________
11+
12+
13+
**Updated**
14+
15+
- Dependencies, removed ``email-validator``.
16+
- ``add_items_to_subset`` added GenAI projects support.
17+
18+
919

1020
4.4.20 - April 11, 2024
1121
_______________________

requirements.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ pydantic>=1.10,!=2.0.*
22
aiohttp~=3.8
33
boto3~=1.26
44
opencv-python-headless~=4.7
5-
packaging~=23.1
5+
packaging~=24.0
66
plotly~=5.14
7-
email-validator~=2.0
87
pandas~=2.0
98
ffmpeg-python~=0.2
109
pillow>=9.5,~=10.0
@@ -13,4 +12,4 @@ requests==2.*
1312
aiofiles==23.*
1413
fire==0.4.0
1514
mixpanel==4.8.3
16-
superannotate-schemas==1.0.47b5
15+
superannotate-schemas==1.0.49

src/superannotate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44

55

6-
__version__ = "4.4.20"
6+
__version__ = "4.4.21"
77

88
sys.path.append(os.path.split(os.path.realpath(__file__))[0])
99

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,7 @@ def __init__(
14671467
self._folder = folder
14681468
self._service_provider = service_provider
14691469
self._items = items
1470-
self._item_name_id_map = {}
1470+
self._item_id_name_map = {}
14711471
self._item_names_provided = True
14721472
self._big_annotations_queue = None
14731473

@@ -1502,9 +1502,8 @@ def _prettify_annotations(self, annotations: List[dict]):
15021502
if names_provided:
15031503
re_struct[annotation["metadata"]["name"]] = annotation
15041504
else:
1505-
re_struct[
1506-
self._item_name_id_map[annotation["metadata"]["name"]]
1507-
] = annotation
1505+
if annotation["metadata"]["id"] in self._item_id_name_map.keys():
1506+
re_struct[annotation["metadata"]["id"]] = annotation
15081507
try:
15091508
return [re_struct[x] for x in self._items if x in re_struct]
15101509
except KeyError:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ def __build_query_string(self, path, item_names):
971971
_, folder = extract_project_folder(path)
972972
if not folder:
973973
folder = "root"
974-
query_str = f"metadata(name IN {str(item_names)}) AND folder={folder}"
974+
query_str = f"metadata(name IN {str(item_names)}) AND folderName={folder}"
975975

976976
return query_str
977977

tests/integration/annotations/test_get_annotations.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
class TestGetAnnotations(BaseTestCase):
1414
PROJECT_NAME = "Test-get_annotations"
1515
FOLDER_NAME = "Test-get_annotations"
16+
FOLDER_NAME_2 = "Test-get_annotations_2"
1617
PROJECT_DESCRIPTION = "Desc"
1718
PROJECT_TYPE = "Vector"
1819
TEST_FOLDER_PATH = "data_set/sample_project_vector"
@@ -57,6 +58,30 @@ def test_get_annotations_by_ids(self):
5758

5859
self.assertEqual(len(annotations), 4)
5960

61+
def test_get_annotations_by_ids_with_duplicate_names(self):
62+
sa.create_folder(self.PROJECT_NAME, self.FOLDER_NAME_2)
63+
self._attach_items(count=4, folder=self.FOLDER_NAME_2) # noqa
64+
self._attach_items(count=4) # noqa
65+
66+
sa.create_annotation_classes_from_classes_json(
67+
self.PROJECT_NAME, f"{self.folder_path}/classes/classes.json"
68+
)
69+
_, _, _ = sa.upload_annotations_from_folder_to_project(
70+
self.PROJECT_NAME, self.folder_path
71+
)
72+
_, _, _ = sa.upload_annotations_from_folder_to_project(
73+
f"{self.PROJECT_NAME}/{self.FOLDER_NAME_2}", self.folder_path
74+
)
75+
items = sa.search_items(self.PROJECT_NAME)
76+
folder_items = sa.search_items(f"{self.PROJECT_NAME}/{self.FOLDER_NAME_2}")
77+
all_items = items + folder_items
78+
79+
annotations = sa.get_annotations(
80+
self._project["id"], [i["id"] for i in all_items]
81+
)
82+
83+
self.assertEqual(len(annotations), 8)
84+
6085
def test_get_annotations_by_wrong_item_ids(self):
6186
annotations = sa.get_annotations(self._project["id"], [1, 2, 3])
6287

0 commit comments

Comments
 (0)