Skip to content

Commit 0eed125

Browse files
committed
Update data typing
1 parent 110ee19 commit 0eed125

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ ______________________
1111

1212
**Added**
1313

14-
- ``SAClient.create_categories`` creates one or more categories in a project.
14+
- ``SAClient.create_categories`` creates one or more categories in a project.
1515
- ``SAClient.remove_categories`` removes one or more categories in a project.
1616
- ``SAClient.list_categories`` lists all categories in the project.
1717
- ``SAClient.set_contributors_categories`` assigns one or more categories to specified contributors.
1818
- ``SAClient.remove_contributors_categories`` removes specified categories from contributors.
19-
- ``SAClient.set_items_category`` adds categories to one or more items.
19+
- ``SAClient.set_items_category`` adds categories to one or more items.
2020
- ``SAClient.remove_items_category`` removes categories from one or more items.
2121

2222
**Updated**

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from enum import auto
33
from enum import Enum
44
from typing import Any
5+
from typing import List
56
from typing import Optional
67
from typing import Union
78

@@ -134,7 +135,7 @@ class WMProjectUserEntity(TimedBaseModel):
134135
state: Optional[WMUserStateEnum]
135136
custom_fields: Optional[dict] = Field(dict(), alias="customField")
136137
permissions: Optional[dict]
137-
categories: Optional[list[dict]]
138+
categories: Optional[List[dict]]
138139

139140
class Config:
140141
extra = Extra.ignore

src/superannotate/lib/core/serviceproviders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def set_remove_contributor_categories(
236236
category_ids: List[int],
237237
operation: Literal["set", "remove"],
238238
chunk_size=100,
239-
) -> list[dict]:
239+
) -> List[dict]:
240240
raise NotImplementedError
241241

242242

tests/integration/items/test_attach_category.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import time
44
from pathlib import Path
5+
from typing import List
56
from unittest import TestCase
67

78
from src.superannotate import SAClient
@@ -59,7 +60,7 @@ def tearDownClass(cls) -> None:
5960
pass
6061

6162
@staticmethod
62-
def _attach_items(path: str, names: list[str]):
63+
def _attach_items(path: str, names: List[str]):
6364
sa.attach_items(path, [{"name": name, "url": f"url-{name}"} for name in names])
6465

6566
def test_attache_category(self):

tests/integration/items/test_list_items.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ def test_list_category_filter(self):
109109
include=["categories"],
110110
categories__value__in=["c1", "c2"],
111111
)
112-
assert [i["categories"][0]["value"] for i in items] == ["c1", "c2"]
112+
assert sorted([i["categories"][0]["value"] for i in items]) == sorted(
113+
["c1", "c2"]
114+
)
113115
assert (
114116
len(
115117
sa.list_items(

0 commit comments

Comments
 (0)