Skip to content

Commit 7b402db

Browse files
committed
adressing PR comments
1 parent d4cfb5e commit 7b402db

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,14 @@ def validate_items(
10021002
self.items = self.__filter_invalid_items()
10031003
self.__separate_to_paths()
10041004

1005+
def validate_project(self):
1006+
response = self._backend_client.validate_saqul_query(
1007+
self.project.team_id, self.project.id, "_"
1008+
)
1009+
error = response.get("error")
1010+
if error:
1011+
raise AppException(response["error"])
1012+
10051013
def execute(
10061014
self,
10071015
):
@@ -1026,11 +1034,13 @@ def execute(
10261034
self.project.team_id,
10271035
self.project.id,
10281036
self.subset_name,
1029-
self.reporter,
1030-
)[0]
1037+
)
1038+
1039+
self.reporter.log_info("You've successfully created a new subset - {subset name}.")
10311040

10321041
subset_id = subset["id"]
10331042
response = None
1043+
10341044
for i in range(0, len(self.item_ids), self.CHUNK_SIZE):
10351045
tmp_response = self._backend_client.add_items_to_subset(
10361046
project_id=self.project.id,

src/superannotate/lib/infrastructure/services.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,7 +1714,7 @@ def get_subset(self, team_id, project_id, subset_name):
17141714

17151715
return None
17161716

1717-
def create_subset(self, team_id, project_id, subset_name, reporter):
1717+
def create_subset(self, team_id, project_id, subset_name):
17181718

17191719
create_subset_url = urljoin(
17201720
self.api_url, self.URL_CREATE_SUBSET.format(project_id=project_id)
@@ -1732,6 +1732,5 @@ def create_subset(self, team_id, project_id, subset_name, reporter):
17321732
if not response.ok:
17331733
raise AppException(response.json().get("errors", "undefined"))
17341734

1735-
reporter.log_info("You've successfully created a new subset - {subset name}.")
17361735

1737-
return response.json()
1736+
return response.json()[0]

0 commit comments

Comments
 (0)