Skip to content

Commit 74ae4ba

Browse files
authored
Merge pull request #848 from superannotateai/develop
Develop
2 parents 4114e10 + 8d5a9ea commit 74ae4ba

7 files changed

Lines changed: 44 additions & 11 deletions

File tree

docs/source/api_reference/api_metadata.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,23 @@ Setting metadata example:
5757
"value": 3
5858
}
5959
60+
----------
61+
62+
Workflow metadata
63+
_________________
64+
65+
Workflow metadata example:
66+
67+
.. code-block:: python
68+
69+
{
70+
"createdAt": "2024-09-03T12:48:09.000Z",
71+
"updatedAt": "2024-09-04T12:48:09.000Z",
72+
"id": 1,
73+
"name": "System workflow",
74+
"type": "system",
75+
"description": "This workflow is generated by the system, and prevents annotators from completing items."
76+
}
6077
6178
----------
6279

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,8 +1950,7 @@ def get_project_metadata(
19501950
"id": 1,
19511951
"name": "System workflow",
19521952
"type": "system",
1953-
"description": "This workflow is generated by the system, and prevents annotators from completing items.",
1954-
"raw_config": {"roles": ["Annotator", "QA"], ...}
1953+
"description": "This workflow is generated by the system, and prevents annotators from completing items."
19551954
},
19561955
"upload_state": "INITIAL",
19571956
"contributors": [],
@@ -4533,8 +4532,9 @@ def list_items(
45334532
- name__starts: str
45344533
- name__ends: str
45354534
- annotation_status: str
4535+
- annotation_status__ne: str
45364536
- annotation_status__in: list[str]
4537-
- annotation_status__ne: list[str]
4537+
- annotation_status__notin: list[str]
45384538
- approval_status: Literal["Approved", "Disapproved", None]
45394539
- assignments__user_id: str
45404540
- assignments__user_id__ne: str
@@ -5815,17 +5815,15 @@ def list_workflows(self):
58155815
"id": 1,
58165816
"name": "System workflow",
58175817
"type": "system",
5818-
"description": "This workflow is generated by the system, and prevents annotators from completing items.",
5819-
"raw_config": {"roles": ["Annotator", "QA"], ...}
5818+
"description": "This workflow is generated by the system, and prevents annotators from completing items."
58205819
},
58215820
{
58225821
"createdAt": "2025-01-03T12:48:09.000Z",
58235822
"updatedAt": "2025-01-05T12:48:09.000Z",
58245823
"id": 58758,
58255824
"name": "Custom workflow",
58265825
"type": "user",
5827-
"description": "This workflow custom build.",
5828-
"raw_config": {"roles": ["Custom Annotator", "Custom QA"], ...}
5826+
"description": "This workflow custom build."
58295827
}
58305828
]
58315829
"""

src/superannotate/lib/core/entities/filters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class BaseFilters(TypedDict, total=False):
1818
class ItemFilters(BaseFilters):
1919
annotation_status: str | None
2020
annotation_status__in: list[str] | None
21-
annotation_status__ne: list[str] | None
21+
annotation_status__ne: str | None
22+
annotation_status__notin: list[str] | None
2223
approval_status: str | None
2324
approval_status__in: list[str] | None
2425
approval_status__ne: str | None

src/superannotate/lib/core/entities/project.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ class WorkflowEntity(TimedBaseModel):
6262
name: str | None = None
6363
type: str | None = None
6464
description: str | None = None
65-
raw_config: dict | None = None
6665

6766
def is_system(self):
6867
return self.type == "system"

tests/integration/items/test_list_items.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,25 @@ def test_list_items(self):
4040
)
4141
assert len(items) == 100
4242

43+
assert (
44+
len(sa.list_items(self.PROJECT_NAME, annotation_status="NotStarted")) == 100
45+
)
46+
assert (
47+
len(
48+
sa.list_items(self.PROJECT_NAME, annotation_status__notin=["Completed"])
49+
)
50+
== 100
51+
)
52+
assert (
53+
len(
54+
sa.list_items(
55+
self.PROJECT_NAME,
56+
annotation_status__notin=["Completed", "NotStarted"],
57+
)
58+
)
59+
== 0
60+
)
61+
4362
def test_invalid_filter(self):
4463
with self.assertRaisesRegex(AppException, "Invalid assignments role provided."):
4564
sa.list_items(self.PROJECT_NAME, assignments__user_role__in=["Approved"])

tests/integration/projects/test_get_project_metadata.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ def test_get_project_metadata(self):
8181
project_metadata["workflow"]["description"]
8282
== "This workflow is generated by the system, and prevents annotators from completing items."
8383
)
84-
assert project_metadata["workflow"]["raw_config"]
8584

8685
def test_get_project_by_id(self):
8786
project_metadata = sa.get_project_metadata(self.PROJECT_NAME)

tests/integration/work_management/test_list_workflows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ def test_list_workflows(self):
1919
"This workflow is generated by the "
2020
"system, and prevents annotators from completing items."
2121
)
22-
assert first_workflow["raw_config"]
22+
assert "raw_config" not in first_workflow

0 commit comments

Comments
 (0)