Skip to content

Commit 5e1d026

Browse files
committed
fix folder search
1 parent 99288d1 commit 5e1d026

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/superannotate/lib/core/conditions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def __and__(self, other):
5252

5353
self._condition_set.append(
5454
QueryCondition(
55-
CONDITION_AND, other.build_query(), {other._key: other._value}
55+
CONDITION_AND, other.build_query(), {} if isinstance(other, Condition) else {other._key: other._value}
5656
)
5757
)
5858
return self
@@ -63,7 +63,7 @@ def build_query(self):
6363
)
6464

6565
def get_as_params_dict(self) -> dict:
66-
params = {self._key: self._value}
66+
params = None if isinstance(self, EmptyCondition) else {self._key: self._value}
6767
for condition in self._condition_set:
6868
params.update(condition.pair) # noqa
6969
return params

tests/integration/folders/test_folders.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ def test_search_folders(self):
4343
sa.create_folder(self.PROJECT_NAME, self.TEST_FOLDER_NAME_1)
4444
sa.create_folder(self.PROJECT_NAME, self.TEST_FOLDER_NAME_2)
4545
folders = sa.search_folders(self.PROJECT_NAME, return_metadata=True)
46+
folders = sa.search_folders(self.PROJECT_NAME)
4647
assert all(["is_root" not in folder for folder in folders])
4748

49+
4850
def test_basic_folders(self):
4951
sa.upload_images_from_folder_to_project(
5052
self.PROJECT_NAME, self.folder_path, annotation_status="InProgress"

0 commit comments

Comments
 (0)