Skip to content

Commit 3088ed5

Browse files
committed
Update __init__.py
1 parent da766e6 commit 3088ed5

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Changelog
22
All release highlights of this project will be documented in this file.
3+
## 4.4.1 - July 24, 2022
4+
### Added
5+
- `SAClient.create_custom_fields()` _method_ to create/add new custom fields to a project’s custom field schema.
6+
- `SAClient.get_custom_fields()` _method_ to get a project’s custom field schema.
7+
- `SAClient.delete_custom_fields()` _method_ to remove existing custom fields from a project’s custom field schema.
8+
- `SAClient.upload_custom_values()` _method_ to attach custom field-value pairs to items.
9+
- `SAClient.delete_custom_values()` _method_ to remove custom field-value pairs from items.
10+
### Updated
11+
- the **schema** of `classes JSON` to support the new `"default_value"` key to set a default attribute(s) for a given attribute group.
12+
- `SAClient.get_item_metadata()` _method_ to add a new input argument `include_custom_metadata` to return custom metadata in the result items.
13+
- `SAClient.search_items()` _method_ to add a new input argument `include_custom_metadata` to return custom metadata in the result items.
14+
- `SAClient.query()` _method_ to return custom metadata in the result items.
15+
### Fixed
16+
- `SAClient` _class_ to address the system crash that occurs on instantiation via `config.json` file.
17+
- `SAClient.query()` _method_ to address the issue of not returning more than 50 items.
18+
- `SAClient.upload_annotations_from_folder_to_project()` to address the issue of some fields not being auto populated after the upload is finished.
19+
- `SAClient.get_folder_metadata()`, `SAClient.search_folders()` to address the issue of transforming the ‘+’ sign in a folder to a whitespace.
20+
### Removed
21+
- `superannotate.assign_images()` _function_. Please use the `SAClient.assign_items()` _method_ instead.
22+
- `superannotate.unassign_images()` _function_. Please use the `SAClient.unassign_items()` _method_ instead.
23+
- `superannotate.delete_images()` _function_. Please use the `SAClient.delete_items()` _method_ instead.
24+
###
325
## 4.4.0 - July 03, 2022
426
### Added
527
- `superannotate.SAClient()` _class_ to instantiate team-level authentication and inheriting methods to access the back-end.

src/superannotate/__init__.py

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

4-
__version__ = "4.4.1b5"
4+
__version__ = "4.4.1"
55

66
sys.path.append(os.path.split(os.path.realpath(__file__))[0])
77

src/superannotate/lib/infrastructure/services.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,16 +543,17 @@ def list_images(self, query_string):
543543
return self._get_all_pages(url)
544544

545545
def list_items(self, query_string) -> ServiceResponse:
546+
chunk_size = 2000
546547
url = urljoin(self.api_url, self.URL_GET_ITEMS)
547548
if query_string:
548549
url = f"{url}?{query_string}"
549550
offset = 0
550551
total = []
552+
splitter = "&" if "?" in url else "?"
551553
while True:
552-
splitter = "&" if "?" in url else "?"
553-
url = f"{url}{splitter}offset={offset}"
554+
_url = f"{url}{splitter}offset={offset}"
554555
_response = self._request(
555-
url,
556+
_url,
556557
method="get",
557558
content_type=List[BaseItemEntity],
558559
dispatcher=lambda x: x.pop("data"),
@@ -563,7 +564,7 @@ def list_items(self, query_string) -> ServiceResponse:
563564
return _response
564565
data_len = len(_response.data)
565566
offset += data_len
566-
if _response.count < self.LIMIT or _response.count - offset <= 0:
567+
if _response.count < chunk_size or _response.count - offset <= 0:
567568
break
568569
response = ServiceResponse(_response)
569570
response.data = total

tests/integration/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def test_attach_video_urls(self):
173173
def test_upload_videos(self):
174174
self._create_project()
175175
self.safe_run(self._cli.upload_videos, self.PROJECT_NAME, str(self.video_folder_path))
176-
self.assertEqual(242, len(sa.search_items(self.PROJECT_NAME)))
176+
self.assertEqual(121, len(sa.search_items(self.PROJECT_NAME)))
177177

178178
def test_attach_document_urls(self):
179179
self._create_project("Document")

0 commit comments

Comments
 (0)