Skip to content

Commit 8af52d6

Browse files
committed
Fix delete_folders bug
1 parent 907a3cd commit 8af52d6

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

install.sh renamed to install_dev_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ pip install yapf
3131
# for docs
3232
pip install sphinx sphinx_rtd_theme
3333

34-
# for on PyPI distribution
34+
# for PyPI distribution
3535
pip install twine

superannotate/db/exports.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
SABaseException, SAExistingExportNameException,
1818
SANonExistingExportNameException
1919
)
20-
from .project_api import get_project_and_folder_metadata, get_project_metadata_bare
20+
from .project_api import get_project_metadata_bare
2121

2222
logger = logging.getLogger("superannotate-python-sdk")
2323

@@ -109,7 +109,7 @@ def prepare_export(
109109
:param project: project name
110110
:type project: str
111111
:param folder_names: names of folders to include in the export. If None, whole project will be exported
112-
:type project: list of str
112+
:type folder_names: list of str
113113
:param annotation_statuses: images with which status to include, if None, [ "InProgress", "QualityCheck", "Returned", "Completed"] will be chose
114114
list elements should be one of NotStarted InProgress QualityCheck Returned Completed Skipped
115115
:type annotation_statuses: list of strs

superannotate/db/project_api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,14 @@ def delete_folders(project, folder_names):
199199
:param project: project name
200200
:type project: str
201201
:param folder_names: to be deleted folders' names
202-
:type folder_names: str or list of strs
202+
:type folder_names: list of strs
203203
"""
204204
if not isinstance(project, dict):
205205
project = get_project_metadata_bare(project)
206206
all_folders_metadata = search_folders(project, return_metadata=True)
207+
if not isinstance(folder_names, list):
208+
raise SABaseException(0, "folder_names should be a list of strings")
209+
207210
folder_ids_to_delete = [
208211
f["id"] for f in all_folders_metadata if f["name"] in folder_names
209212
]

superannotate/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "4.1.0b8"
1+
__version__ = "4.1.0b9"

0 commit comments

Comments
 (0)