Skip to content

Commit 591a3db

Browse files
author
Val Brodsky
committed
Update TagFilter to use id
1 parent 7f554a9 commit 591a3db

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

libs/labelbox/src/labelbox/schema/labeling_service_dashboard.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131

3232
class LabelingServiceDashboardTags(BaseModel):
33+
id: str
3334
text: str
3435
color: str
3536
type: str

libs/labelbox/src/labelbox/schema/search_filters.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ class WorkspaceFilter(BaseSearchFilter):
106106
class TagFilter(BaseSearchFilter):
107107
"""
108108
Filter for project tags
109+
110+
values are tag ids
109111
"""
110112
operation: Literal[OperationType.Tag] = OperationType.Tag
111113
operator: IdOperator

libs/labelbox/tests/unit/test_unit_search_filters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ def test_id_filters():
1313
values=["clphb4vd7000cd2wv1ktu5cwa"]),
1414
WorkspaceFilter(operator=IdOperator.Is,
1515
values=["clphb4vd7000cd2wv1ktu5cwa"]),
16-
TagFilter(operator=IdOperator.Is, values=["tag"]),
16+
TagFilter(operator=IdOperator.Is, values=["cls1vkrw401ab072vg2pq3t5d"]),
1717
ProjectStageFilter(operator=IdOperator.Is,
1818
values=[LabelingServiceStatus.Requested]),
1919
]
2020

2121
assert build_search_filter(
2222
filters
23-
) == '[{operator: "is", values: ["clphb4vd7000cd2wv1ktu5cwa"], type: "organization_id"}, {operator: "is", values: ["clphb4vd7000cd2wv1ktu5cwa"], type: "shared_with_organizations"}, {operator: "is", values: ["clphb4vd7000cd2wv1ktu5cwa"], type: "workspace"}, {operator: "is", values: ["tag"], type: "tag"}, {operator: "is", values: ["REQUESTED"], type: "stage"}]'
23+
) == '[{operator: "is", values: ["clphb4vd7000cd2wv1ktu5cwa"], type: "organization_id"}, {operator: "is", values: ["clphb4vd7000cd2wv1ktu5cwa"], type: "shared_with_organizations"}, {operator: "is", values: ["clphb4vd7000cd2wv1ktu5cwa"], type: "workspace"}, {operator: "is", values: ["cls1vkrw401ab072vg2pq3t5d"], type: "tag"}, {operator: "is", values: ["REQUESTED"], type: "stage"}]'
2424

2525

2626
def test_stage_filter_with_invalid_values():

0 commit comments

Comments
 (0)