Skip to content

Commit ceff05b

Browse files
committed
dev8
1 parent f8fa29f commit ceff05b

File tree

11 files changed

+421
-353
lines changed

11 files changed

+421
-353
lines changed

src/superannotate/__init__.py

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

4-
__version__ = "4.4.2dev7"
4+
__version__ = "4.4.2dev8"
55

66
sys.path.append(os.path.split(os.path.realpath(__file__))[0])
77

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

Lines changed: 2 additions & 2 deletions
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
@@ -99,7 +99,7 @@ class DataAggregator:
9999
ry=annotation["ry"],
100100
angle=annotation["angle"],
101101
),
102-
"tag": lambda annotation: None
102+
"tag": lambda annotation: None,
103103
}
104104

105105
def __init__(

src/superannotate/lib/app/interface/sdk_interface.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,12 @@ def search_annotation_classes(
579579
:rtype: list of dicts
580580
"""
581581
project_name, folder_name = extract_project_folder(project)
582-
classes = self.controller.search_annotation_classes(project_name, name_contains)
583-
return [i.dict(fill_enum_values=True) for i in classes.data]
582+
response = self.controller.search_annotation_classes(
583+
project_name, name_contains
584+
)
585+
if response.errors:
586+
raise AppException(response.errors)
587+
return [BaseSerializer(i).serialize(exclude_unset=True) for i in response.data]
584588

585589
def set_project_default_image_quality_in_editor(
586590
self,
@@ -1231,7 +1235,7 @@ def create_annotation_class(
12311235
)
12321236
if response.errors:
12331237
raise AppException(response.errors)
1234-
return BaseSerializer(response.data).serialize()
1238+
return BaseSerializer(response.data).serialize(exclude_unset=True)
12351239

12361240
def delete_annotation_class(
12371241
self, project: NotEmptyStr, annotation_class: Union[dict, NotEmptyStr]
@@ -1308,7 +1312,7 @@ def create_annotation_classes_from_classes_json(
13081312
)
13091313
if response.errors:
13101314
raise AppException(response.errors)
1311-
return [BaseSerializer(i).serialize() for i in response.data]
1315+
return [BaseSerializer(i).serialize(exclude_unset=True) for i in response.data]
13121316

13131317
def download_export(
13141318
self,

src/superannotate/lib/app/serializers.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,17 @@ def serialize(
2727
by_alias: bool = True,
2828
flat: bool = False,
2929
exclude: Set[str] = None,
30+
exclude_unset=False,
3031
):
3132
return self._fill_enum_values(
32-
self._serialize(self._entity, fields, by_alias, flat, exclude=exclude)
33+
self._serialize(
34+
self._entity,
35+
fields,
36+
by_alias,
37+
flat,
38+
exclude=exclude,
39+
exclude_unset=exclude_unset,
40+
)
3341
)
3442

3543
def serialize_item(

src/superannotate/lib/core/config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import threading
2-
from typing import Dict
3-
42
from dataclasses import dataclass
53
from dataclasses import field
4+
from typing import Dict
65

76

87
class Session:

src/superannotate/lib/core/entities/classes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,5 @@ def __hash__(self):
9898
class Config:
9999
validate_assignment = True
100100
exclude_none = True
101+
exclude_unset = True
101102
fill_enum_values = True

0 commit comments

Comments
 (0)