Skip to content

Commit 5986595

Browse files
Vaghinak BasentsyanVaghinak Basentsyan
authored andcommitted
Changed pandas version, added init in the set_auth_token function
1 parent b80df43 commit 5986595

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ xmltodict==0.12.0
1010
opencv-python==4.4.0.42
1111
wheel==0.35.1
1212
packaging>=20.4
13-
pandas==1.1.2
13+
pandas>=1.1.4
1414
plotly==4.1.0
1515
ffmpeg-python>=0.2.0
1616
fire==0.4.0

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def init(path_to_config_json: str):
6666
@typechecked
6767
def set_auth_token(token: str):
6868
controller.set_token(token)
69+
controller.init(controller.config_path)
6970

7071

7172
@Trackable
@@ -864,10 +865,10 @@ def get_project_metadata(
864865
).data
865866

866867
metadata = ProjectSerializer(response["project"]).serialize()
867-
if response.get("settings"):
868-
metadata["settings"] = [
869-
SettingsSerializer(setting).serialize() for setting in response["settings"]
870-
]
868+
metadata["settings"] = [
869+
SettingsSerializer(setting).serialize()
870+
for setting in response.get("settings", [])
871+
]
871872

872873
for elem in "classes", "workflows", "contributors":
873874
if response.get(elem):

src/superannotate/lib/core/usecases.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3382,6 +3382,8 @@ def execute(self):
33823382
logger.warning(
33833383
f"Couldn't find image {missing.path} for annotation upload."
33843384
)
3385+
if not annotations_to_upload:
3386+
raise AppException("No image to attach annotations.")
33853387

33863388
if self._pre_annotation:
33873389
auth_data = self._backend_service.get_pre_annotation_upload_data(

src/superannotate/lib/infrastructure/controller.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ def init(self, config_path):
8787
self._backend_client.api_url = self.configs.get_one("main_endpoint").value
8888
self._backend_client._auth_token = self.configs.get_one("token").value
8989

90+
@property
91+
def config_path(self):
92+
return self._config_path
93+
9094
@property
9195
def user_id(self):
9296
if not self._user_id:

tests/integration/test_annotation_adding.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ def folder_path(self):
2424
def classes_json_path(self):
2525
return f"{self.folder_path}/classes/classes.json"
2626

27+
def test_upload_annotations(self):
28+
sa.upload_images_from_folder_to_project(
29+
self.PROJECT_NAME, self.folder_path, annotation_status="InProgress"
30+
)
31+
sa.upload_annotations_from_folder_to_project(
32+
self.PROJECT_NAME, self.folder_path
33+
)
34+
2735
def test_add_bbox(self):
2836
sa.upload_images_from_folder_to_project(
2937
self.PROJECT_NAME, self.folder_path, annotation_status="InProgress"

0 commit comments

Comments
 (0)