Skip to content

Commit 185248f

Browse files
authored
Merge pull request #367 from superannotateai/develop-624
Add log
2 parents d3ecefb + 5de410e commit 185248f

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

src/superannotate/lib/app/analytics/aggregators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import copy
22
import json
3+
from dataclasses import dataclass
34
from pathlib import Path
45
from typing import List
56
from typing import Optional
67
from typing import Union
78

89
import lib.core as constances
910
import pandas as pd
10-
from dataclasses import dataclass
1111
from lib.app.exceptions import AppException
1212
from lib.core import ATTACHED_VIDEO_ANNOTATION_POSTFIX
1313
from lib.core import PIXEL_ANNOTATION_POSTFIX

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ def annotations_to_upload(self):
137137
self._annotations_to_upload = annotations_to_upload
138138
return self._annotations_to_upload
139139

140+
@property
141+
def missing_annotations(self):
142+
if not self._missing_annotations:
143+
self._missing_annotations = []
144+
return self._missing_annotations
145+
140146
def get_annotation_upload_data(
141147
self, image_ids: List[int]
142148
) -> UploadAnnotationAuthData:
@@ -223,7 +229,10 @@ def _log_report(self):
223229
logger.warning(template.format("', '".join(values)))
224230
if self.reporter.custom_messages.get("invalid_jsons"):
225231
logger.warning(
226-
f"Couldn't validate {len(self.reporter.custom_messages['invalid_jsons'])}/{len(self._annotations_to_upload + self._missing_annotations)} annotations from {self._folder_path}."
232+
f"Couldn't validate {len(self.reporter.custom_messages['invalid_jsons'])}/"
233+
f"{len(self.annotations_to_upload + self.missing_annotations)} annotations from {self._folder_path}. "
234+
f"Use the validate_annotations function to discover the possible reason(s) for "
235+
f"which an annotation is invalid."
227236
)
228237

229238
def execute(self):
@@ -281,7 +290,7 @@ def execute(self):
281290
self._response.data = (
282291
uploaded_annotations,
283292
failed_annotations,
284-
[annotation.path for annotation in self._missing_annotations],
293+
[annotation.path for annotation in self.missing_annotations],
285294
)
286295
return self._response
287296

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ def execute(self):
10551055
if invited:
10561056
self.reporter.log_info(
10571057
f"Sent team {'admin' if self._set_admin else 'contributor'} invitations"
1058-
f" to {len(to_add)}/{len(self._emails)} users."
1058+
f" to {len(invited)}/{len(self._emails)} users."
10591059
)
10601060
if failed:
10611061
to_skip = set(to_skip)

src/superannotate/version.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
__version__ = "4.2.9b1"
2-

tests/integration/annotations/test_text_annotation_upload.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def test_document_annotation_upload_invalid_json(self):
5858
self.assertEqual(len(failed_annotations), 1)
5959
self.assertEqual(len(missing_annotations), 0)
6060
self.assertIn("Couldn't validate 1/1 annotations", self._caplog.text)
61+
self.assertIn("Use the validate_annotations function to discover the possible reason(s) for which an annotation is invalid.", self._caplog.text)
6162

6263
def test_text_annotation_upload(self):
6364
sa.create_annotation_classes_from_classes_json(self.PROJECT_NAME, self.classes_path)

0 commit comments

Comments
 (0)