Skip to content

Commit ab9a894

Browse files
authored
Merge pull request #464 from superannotateai/1187_query_fix
1187 query fix
2 parents 167b043 + 8f183be commit ab9a894

File tree

8 files changed

+200
-17
lines changed

8 files changed

+200
-17
lines changed

CHANGELOG.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,70 @@
11
# Changelog
2-
All release higlighths of this project will be documented in this file.
2+
All release highlights of this project will be documented in this file.
3+
## 4.4.0 - July 03, 2022
4+
### Added
5+
- `superannotate.SAClient()` _class_ to instantiate team-level authentication and inheriting methods to access the back-end.
6+
- `SAClient.download_annotations()` _method_ to download annotations without preparing an Export object.
7+
- `SAClient.get_subsets()` _method_ to get the existing subsets for a given project.
8+
- `SAClient.assign_items()` _method_ to assign items in a given project to annotators or quality specialists.
9+
- `SAClient.unassign_items()` _method_ to remove assignments from items.
10+
- `SAClient.delete_items()` _method_ to delete items in a given project.
11+
### Updated
12+
- `JSON Schema` for video annotations to version `1.0.45` to show **polygon** and **polyline** annotations.
13+
- `SAClient.get_annotations_per_frame()` _method_ to show **polygon** and **polyline** annotations.
14+
- `SAClient.get_annotations_per_frame()` _method_ to pick instances closer to a given **frame start** instead of the **median**.
15+
- `SAClient.query()` _method_ to add the `subset` argument to support querying in a subset.
16+
### Fixed
17+
- `SAClient.set_annotation_statuses()` _method_ to address the issue occurring with more than 500 items.
18+
- `SAClient.get_annotations()` _method_ to address the `PayloadError` occurring with more than 20000 items.
19+
- `SAClient.get_annotations()` _method_ to address the missing `'duration'` and `'tags'` keys for newly uploaded and unannotated videos.
20+
- `SAClient.get_annotations_per_frame()` _method_ to address missing `'duration'` and `'tags'` keys for newly uploaded and unannotated videos.
21+
- `SAClient.get_annotations_per_frame()` _method_ to address the wrong `classId` value for unclassified instances.
22+
### Removed
23+
- `superannotate.init()` _function_. Please instantiate `superannotate.SAClient()` _class_ to authenticate.
24+
- `superannotate.set_image_annotation_status()` _function_. Please use the `SAClient.set_annotation_statuses()` _method_ instead.
25+
- `superannotate.set_images_annotations_statuses()` _function_. Please use the `SAClient.set_annotation_statuses()` _method_ instead.
26+
## 4.3.4 - May 22, 2022
27+
### Updated
28+
- `JSON Schema` for video annotations to version `x` to reflect point annotations.
29+
- `superannotate.download_export()` function to preserve SA folder structure while downloading to S3 bucket.
30+
- `superannotate.get_item_metadata()` function to have string type values instead of int type for the `approval_status` key.
31+
- `superannotate.get_item_metadata()` function to change the value for the `path` key in the item metadata from `project/folder/item` format to `project/folder`.
32+
- `superannotate.get_item_metadata()` function to add the `is_pinned` key in the returned metadata.
33+
- `superannotate.clone_project()` function to have `NotStarted` project status for the newly created project.
34+
### Fixed
35+
- `superannotate.query()` function to address the missing value for the `path` key.
36+
- `superannotate.import_annotation()` function to address the extension issue with JPEG files while converting from `VOC` to SA.
37+
- `superannotate.import_annotation()` function to address int type pointlabels in the converted `JSON` from `COCO` to SA.
38+
- `superannotate_get_annotations()` & `superannotate.add_annotation_comment_to_image()` to address the issue with `asyncio` occuring on Windows.
39+
- `superannotate.set_image_annotation_status()` function add a deprecation warning.
40+
- `superannotate.set_images_annotation_statuses()` function add a deprecation warning.
41+
### Removed
42+
- `share_projects()` function.
43+
- `superannotate.attach_image_urls_to_project()` function. Please use the `superannotate.attach_items()` function instead.
44+
- `superannotate.attach_document_urls_to_project()` function. Please use the `superannotate.attach_items()` function instead.
45+
- `superannotate.attach_video_urls_to_project()` function. Please use the `superannotate.attach_items()` function instead.
46+
- `superannotate.copy_images()` function. Please use the `superannotate.copy_items()` function instead.
47+
- `superannotate.move_images()` function. Please use the `superannotate.move_items()` function instead.
48+
###
49+
## 4.3.3 - May 01 2022
50+
### Added
51+
- `attach_items()` function to link items (images, videos, and documents) from external storages to SuperAnnotate using URLs.
52+
- `copy_items()` function to copy items (images, videos, and documents) in bulk between folders in a project.
53+
- `move_items()` function to move items (images, videos, and documents) in bulk between folders in a project.
54+
- `set_annotation_statuses()` function to change the annotation status of items (images, videos, and documents) in bulk.
55+
### Updated
56+
- `aggregate_annotations_as_df()` function now supports Text Projects.
57+
### Fixed
58+
- `validate_annotations()` function to accept only numeric type values for the `points` field.
59+
- `prepare_export()` function to address the issue when the entire project is prepared when a wrong folder name is provided.
60+
- `search_team_contributors()` function to address the error message when `email` parameter is used.
61+
- `get_item_metadata()` to address the issue with approved/disapproved items.
62+
### Removed
63+
- `get_project_and_folder_metadata()` function.
64+
- `get_image_metadata()` function. Please use `get_item_metadata()` instead.
65+
- `search_images()` function. Please use `search_items()` instead.
66+
- `search images_all_folders()` function. Please use `search_items()` instead.
67+
###
368
## 4.3.2 - April 10 2022
469
### Added
570
- `query()` function to run SAQuL queries via SDK.

docs/source/superannotate.sdk.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ ______
7171
.. automethod:: superannotate.SAClient.attach_items
7272
.. automethod:: superannotate.SAClient.copy_items
7373
.. automethod:: superannotate.SAClient.move_items
74+
.. automethod:: superannotate.SAClient.delete_items
7475
.. automethod:: superannotate.SAClient.assign_items
7576
.. automethod:: superannotate.SAClient.unassign_items
7677
.. automethod:: superannotate.SAClient.get_item_metadata
@@ -404,4 +405,4 @@ Utility functions
404405
--------------------------------
405406

406407
.. autofunction:: superannotate.SAClient.consensus
407-
.. autofunction:: superannotate.SAClient.benchmark
408+
.. autofunction:: superannotate.SAClient.benchmark

requirements_prod.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
superannotate_schemas==1.0.41
1+
superannotate_schemas==1.0.45

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ def search_annotation_classes(
572572
:type project: str
573573
:param name_contains: search string. Returns those classes,
574574
where the given string is found anywhere within its name. If None, all annotation classes will be returned.
575-
:type name_prefix: str
575+
:type name_contains: str
576576
577577
:return: annotation classes of the project
578578
:rtype: list of dicts
@@ -1614,12 +1614,19 @@ def upload_image_annotations(
16141614
16151615
:param project: project name or folder path (e.g., "project1/folder1")
16161616
:type project: str
1617+
16171618
:param image_name: image name
16181619
:type image_name: str
1620+
16191621
:param annotation_json: annotations in SuperAnnotate format JSON dict or path to JSON file
16201622
:type annotation_json: dict or Path-like (str or Path)
1623+
16211624
:param mask: BytesIO object or filepath to mask annotation for pixel projects in SuperAnnotate format
16221625
:type mask: BytesIO or Path-like (str or Path)
1626+
1627+
:param verbose: Turns on verbose output logging during the proces.
1628+
:type verbose: bool
1629+
16231630
"""
16241631

16251632
project_name, folder_name = extract_project_folder(project)
@@ -2413,7 +2420,7 @@ def query(
24132420
:type query: str
24142421
24152422
:param subset: subset name. Allows you to query items in a specific subset.
2416-
To return all the items in the specified subset, set the value of query param to None.
2423+
To return all the items in the specified subset, set the value of query param to None.
24172424
:type subset: str
24182425
24192426
:return: queried items’ metadata list

src/superannotate/lib/infrastructure/services.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,17 +1209,19 @@ def saqul_query(
12091209
if query:
12101210
data["query"] = query
12111211
items = []
1212-
for _ in range(self.MAX_ITEMS_COUNT):
1212+
response = requests.Response()
1213+
for _ in range(0, self.MAX_ITEMS_COUNT, self.SAQUL_CHUNK_SIZE):
12131214
response = self._request(query_url, "post", params=params, data=data)
1214-
if response.ok:
1215-
response_items = response.json()
1216-
items.extend(response_items)
1217-
if len(response_items) < self.SAQUL_CHUNK_SIZE:
1218-
service_response = ServiceResponse(response)
1219-
service_response.data = items
1220-
return service_response
1221-
data["image_index"] += self.SAQUL_CHUNK_SIZE
1222-
return ServiceResponse(response)
1215+
if not response.ok:
1216+
break
1217+
response_items = response.json()
1218+
items.extend(response_items)
1219+
if len(response_items) < self.SAQUL_CHUNK_SIZE:
1220+
service_response = ServiceResponse(response)
1221+
service_response.data = items
1222+
return service_response
1223+
data["image_index"] += self.SAQUL_CHUNK_SIZE
1224+
return ServiceResponse(response)
12231225

12241226
def validate_saqul_query(self, team_id: int, project_id: int, query: str) -> dict:
12251227
validate_query_url = urljoin(self.api_url, self.URL_VALIDATE_SAQUL_QUERY)

src/superannotate/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "4.3.5dev23"
1+
__version__ = "4.4.0"

tests/data_set/100_urls.csv

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
url,name
2+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_0
3+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_1
4+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_2
5+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_3
6+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_4
7+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_5
8+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_6
9+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_7
10+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_8
11+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_9
12+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_10
13+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_11
14+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_12
15+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_13
16+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_14
17+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_15
18+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_16
19+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_17
20+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_18
21+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_19
22+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_20
23+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_21
24+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_22
25+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_23
26+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_24
27+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_25
28+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_26
29+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_27
30+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_28
31+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_29
32+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_30
33+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_31
34+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_32
35+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_33
36+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_34
37+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_35
38+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_36
39+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_37
40+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_38
41+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_39
42+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_40
43+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_41
44+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_42
45+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_43
46+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_44
47+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_45
48+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_46
49+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_47
50+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_48
51+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_49
52+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_50
53+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_51
54+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_52
55+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_53
56+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_54
57+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_55
58+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_56
59+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_57
60+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_58
61+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_59
62+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_60
63+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_61
64+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_62
65+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_63
66+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_64
67+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_65
68+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_66
69+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_67
70+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_68
71+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_69
72+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_70
73+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_71
74+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_72
75+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_73
76+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_74
77+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_75
78+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_76
79+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_77
80+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_78
81+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_79
82+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_80
83+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_81
84+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_82
85+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_83
86+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_84
87+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_85
88+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_86
89+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_87
90+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_88
91+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_89
92+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_90
93+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_91
94+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_92
95+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_93
96+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_94
97+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_95
98+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_96
99+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_97
100+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_98
101+
https://drive.google.com/uc?export=download&id=1vwfCpTzcjxoEA4hhDxqapPOVvLVeS7ZS,name_99

tests/integration/items/test_saqul_query.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from src.superannotate import SAClient
55
from tests.integration.base import BaseTestCase
6+
from tests import DATA_SET_PATH
67

78
sa = SAClient()
89

@@ -16,9 +17,10 @@ class TestEntitiesSearchVector(BaseTestCase):
1617
TEST_QUERY = "instance(type =bbox )"
1718
TEST_INVALID_QUERY = "!instance(type =bbox )!"
1819

20+
1921
@property
2022
def folder_path(self):
21-
return os.path.join(Path(__file__).parent.parent.parent, self.TEST_FOLDER_PATH)
23+
return os.path.join(Path(__file__).parent.parent, self.TEST_FOLDER_PATH)
2224

2325
def test_query(self):
2426
sa.create_folder(self.PROJECT_NAME, self.FOLDER_NAME)
@@ -46,6 +48,11 @@ def test_query(self):
4648
"Subset not found. Use the superannotate.get_subsets() function to get a list of the available subsets."
4749
)
4850

51+
def test_query_on_100(self):
52+
sa.attach_items(self.PROJECT_NAME, os.path.join(DATA_SET_PATH, "100_urls.csv"))
53+
entities = sa.query(self.PROJECT_NAME, "metadata(status = NotStarted)")
54+
print(len(entities))
55+
4956
def test_validate_saqul_query(self):
5057
try:
5158
self.assertRaises(Exception, sa.query(self.PROJECT_NAME, self.TEST_INVALID_QUERY))

0 commit comments

Comments
 (0)