Skip to content

Commit f48a5d1

Browse files
committed
Docstring fix
1 parent 0ccaa5d commit f48a5d1

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
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
43
from pathlib import Path
54
from typing import List
65
from typing import Optional
76
from typing import Union
87

98
import lib.core as constances
109
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/app/interface/base_interface.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def __init__(self, token: str = None, config_path: str = None):
3434
else:
3535
_token = os.environ.get("SA_TOKEN")
3636
if not _token:
37-
_toke, _host, _ssl_verify = self._retrieve_configs(
37+
_token, _host, _ssl_verify = self._retrieve_configs(
3838
constants.CONFIG_PATH
3939
)
4040
self._token, self._host = _token, _host
@@ -90,11 +90,14 @@ def __init__(self, function):
9090
def get_client(self):
9191
if not self._client:
9292
if BaseInterfaceFacade.REGISTRY:
93-
self._client = BaseInterfaceFacade.REGISTRY[-1]
93+
return BaseInterfaceFacade.REGISTRY[-1]
9494
else:
9595
from lib.app.interface.sdk_interface import SAClient
9696

97-
self._client = SAClient()
97+
try:
98+
return SAClient()
99+
except Exception:
100+
pass
98101
elif hasattr(self._client, "controller"):
99102
return self._client
100103

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class SAClient(BaseInterfaceFacade, metaclass=TrackableMeta):
6565
def __init__(
6666
self,
6767
token: str = None,
68-
config_path: str = constants.CONFIG_PATH,
68+
config_path: str = None,
6969
):
7070
super().__init__(token, config_path)
7171

@@ -2669,7 +2669,7 @@ def set_annotation_statuses(
26692669
self,
26702670
project: Union[NotEmptyStr, dict],
26712671
annotation_status: AnnotationStatuses,
2672-
item_names: Optional[List[NotEmptyStr]] = None,
2672+
items: Optional[List[NotEmptyStr]] = None,
26732673
):
26742674
"""Sets annotation statuses of items
26752675
@@ -2686,15 +2686,15 @@ def set_annotation_statuses(
26862686
:type annotation_status: str
26872687
26882688
:param items: item names to set the mentioned status for. If None, all the items in the project will be used.
2689-
:type items: str
2689+
:type items: list of strs
26902690
"""
26912691

26922692
project_name, folder_name = extract_project_folder(project)
26932693
response = self.controller.set_annotation_statuses(
26942694
project_name=project_name,
26952695
folder_name=folder_name,
26962696
annotation_status=annotation_status,
2697-
item_names=item_names,
2697+
item_names=items,
26982698
)
26992699
if response.errors:
27002700
raise AppException(response.errors)

src/superannotate/lib/core/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import threading
2+
from typing import Dict
3+
24
from dataclasses import dataclass
35
from dataclasses import field
4-
from typing import Dict
56

67

78
class Session:

tests/integration/items/test_set_annotation_statuses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def test_image_annotation_status_via_names(self):
6565

6666
def test_image_annotation_status_via_invalid_names(self):
6767
sa.attach_items(
68-
self.PROJECT_NAME, self.ATTACHMENT_LIST, annotation_status="InProgress"
68+
self.PROJECT_NAME, self.ATTACHMENT_LIST, "InProgress"
6969
)
7070
with self.assertRaisesRegexp(AppException, SetAnnotationStatues.ERROR_MESSAGE):
7171
sa.set_annotation_statuses(

0 commit comments

Comments
 (0)