Skip to content

Commit 11abe69

Browse files
committed
Version update
1 parent e1ebe30 commit 11abe69

File tree

7 files changed

+17
-16
lines changed

7 files changed

+17
-16
lines changed

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ minversion = 3.7
33
log_cli=true
44
python_files = test_*.py
55
;pytest_plugins = ['pytest_profiling']
6-
addopts = -n auto --dist=loadscope
6+
;addopts = -n auto --dist=loadscope
77

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
import typing
55

6-
__version__ = "4.4.10dev7"
6+
__version__ = "4.4.10dev8"
77

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

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,12 +1486,12 @@ async def run_workers(
14861486
)
14871487
if small_annotations:
14881488
self._small_annotations_queue = asyncio.Queue()
1489-
small_chunks = divide_to_chunks(
1490-
small_annotations, size=self._config.ANNOTATION_CHUNK_SIZE
1491-
)
1492-
for chunk in small_chunks:
1493-
self._small_annotations_queue.put_nowait(chunk)
1494-
self._small_annotations_queue.put_nowait(None)
1489+
small_chunks = divide_to_chunks(
1490+
small_annotations, size=self._config.ANNOTATION_CHUNK_SIZE
1491+
)
1492+
for chunk in small_chunks:
1493+
self._small_annotations_queue.put_nowait(chunk)
1494+
self._small_annotations_queue.put_nowait(None)
14951495

14961496
annotations.extend(
14971497
list(
@@ -1520,11 +1520,13 @@ def execute(self):
15201520
self.reporter.log_warning(
15211521
f"Could not find annotations for {len_provided_items - len_items}/{len_provided_items} items."
15221522
)
1523-
else:
1523+
elif self._item_names is None:
15241524
condition = Condition("project_id", self._project.id, EQ) & Condition(
15251525
"folder_id", self._folder.id, EQ
15261526
)
15271527
items = get_or_raise(self._service_provider.items.list(condition))
1528+
else:
1529+
items = []
15281530
id_item_map = {i.id: i for i in items}
15291531
if not items:
15301532
logger.info("No annotations to download.")

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,8 +704,8 @@ def execute(self):
704704
team_users = set()
705705
project_users = {user.user_id for user in self._project.users}
706706
for user in self._team.users:
707-
if user["user_role"] > constances.UserRole.ADMIN.value:
708-
team_users.add(user["email"])
707+
if user.user_role > constances.UserRole.ADMIN.value:
708+
team_users.add(user.email)
709709
# collecting pending team users which is not admin
710710
for user in self._team.pending_invitations:
711711
if user["user_role"] > constances.UserRole.ADMIN.value:
@@ -772,7 +772,7 @@ def __init__(
772772

773773
def execute(self):
774774
if self.is_valid():
775-
team_users = {user["email"] for user in self._team.users}
775+
team_users = {user.email for user in self._team.users}
776776
# collecting pending team users
777777
team_users.update(
778778
{user["email"] for user in self._team.pending_invitations}

src/superannotate/lib/infrastructure/services/annotation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ async def upload_small_annotations(
301301
response = UploadAnnotationsResponse()
302302
response.status = _response.status
303303
response._content = await _response.text()
304+
# TODO add error handling
304305
response.data = parse_obj_as(UploadAnnotations, data_json)
305306
return response
306307

tests/integration/annotations/test_get_annotations.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def test_get_annotations_logs(self):
130130
items_names = [self.IMAGE_NAME] * 4
131131
items_names.append("Non-existent item")
132132
with self.assertLogs("sa", level="INFO") as cm:
133-
assert len(sa.get_annotations(self.PROJECT_NAME, items_names)) == 4
133+
assert len(sa.get_annotations(self.PROJECT_NAME, items_names)) == 1
134134
assert (
135135
"INFO:sa:Dropping duplicates. Found 2/5 unique items." == cm.output[0]
136136
)
@@ -206,5 +206,3 @@ def test_empty_list_get(self):
206206
)
207207
annotations = sa.get_annotations(self.PROJECT_NAME, items=[])
208208
assert len(annotations) == 0
209-
annotations = sa.get_annotations(self.PROJECT_NAME, items=None)
210-
assert len(annotations) == 2

tests/integration/annotations/video/test_get_annotations_per_frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ def test_video_annotation_upload(self):
6262
"INFO:sa:Getting annotations for 31 frames from video.mp4."
6363
== cm.output[0]
6464
)
65-
assert cm.output[0] == 1
65+
assert len(cm.output) == 1

0 commit comments

Comments
 (0)