Skip to content

Commit 6434a56

Browse files
authored
Merge pull request #691 from superannotateai/develop
Develop
2 parents ffe9446 + 1d5eea6 commit 6434a56

File tree

5 files changed

+39
-6
lines changed

5 files changed

+39
-6
lines changed

CHANGELOG.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ History
66

77
All release highlights of this project will be documented in this file.
88

9+
4.4.22 - Jun 13, 2024
10+
_______________________
11+
12+
13+
**Updated**
14+
15+
- Dependencies, updated ``packaging``, ``superannotate-schemas``.
16+
- ``search_folders`` by multiple statuses.
17+
18+
919
4.4.21 - May 23, 2024
1020
_______________________
1121

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pydantic>=1.10,!=2.0.*
22
aiohttp~=3.8
33
boto3~=1.26
44
opencv-python-headless~=4.7
5-
packaging~=23.1
5+
packaging~=24.0
66
plotly~=5.14
77
pandas~=2.0
88
ffmpeg-python~=0.2
@@ -12,4 +12,4 @@ requests==2.*
1212
aiofiles==23.*
1313
fire==0.4.0
1414
mixpanel==4.8.3
15-
superannotate-schemas==1.0.47b5
15+
superannotate-schemas==1.0.49

src/superannotate/__init__.py

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

55

6-
__version__ = "4.4.21"
6+
__version__ = "4.4.22"
77

88
sys.path.append(os.path.split(os.path.realpath(__file__))[0])
99

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,9 +627,11 @@ def search_folders(
627627
if return_metadata:
628628
condition &= Condition("includeUsers", return_metadata, EQ)
629629
if status:
630-
condition &= Condition(
631-
"status", constants.FolderStatus.get_value(status), EQ
632-
)
630+
if isinstance(status, list):
631+
status_condition = [constants.FolderStatus.get_value(i) for i in status]
632+
else:
633+
status_condition = constants.FolderStatus.get_value(status)
634+
condition &= Condition("status", status_condition, EQ)
633635
response = self.controller.folders.list(project, condition)
634636
if response.errors:
635637
raise AppException(response.errors)

tests/integration/folders/test_search_folders.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class TestSearchFolders(BaseTestCase):
1313
SPECIAL_CHARS = r"/\:*?“<>|"
1414
TEST_FOLDER_NAME_1 = "folder_1"
1515
TEST_FOLDER_NAME_2 = "folder_2"
16+
TEST_FOLDER_NAME_3 = "folder_3"
1617

1718
def test_search_folders(self):
1819
sa.create_folder(self.PROJECT_NAME, self.TEST_FOLDER_NAME_1)
@@ -29,6 +30,26 @@ def test_search_folders(self):
2930
folders = sa.search_folders(self.PROJECT_NAME, status="NotStarted")
3031
assert len(folders) == 2
3132

33+
# with status list
34+
sa.create_folder(self.PROJECT_NAME, self.TEST_FOLDER_NAME_3)
35+
sa.set_folder_status(
36+
self.PROJECT_NAME, self.TEST_FOLDER_NAME_3, status="InProgress"
37+
)
38+
folders_2 = sa.search_folders(
39+
self.PROJECT_NAME, status=["NotStarted", "InProgress", "Completed"]
40+
)
41+
assert len(folders_2) == 3
42+
43+
folders_3 = sa.search_folders(
44+
self.PROJECT_NAME, status=["InProgress", "Completed"]
45+
)
46+
assert len(folders_3) == 1
47+
48+
folders_4 = sa.search_folders(
49+
self.PROJECT_NAME, status=["NotStarted", "Completed"]
50+
)
51+
assert len(folders_4) == 2
52+
3253
# with invalid status
3354
pattern = (
3455
r"(\s+)status(\s+)Available values are 'NotStarted', "

0 commit comments

Comments
 (0)