meilisearch-python-sdk 7.5.1__tar.gz → 7.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/PKG-INFO +2 -1
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/_batch.py +3 -3
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/_client/_async_client.py +46 -4
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/_client/_client.py +46 -4
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/_task.py +131 -63
- meilisearch_python_sdk-7.5.2/meilisearch_python_sdk/_version.py +1 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/prek.toml +2 -2
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/pyproject.toml +3 -2
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/test_async_client.py +84 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/test_client.py +80 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/uv.lock +278 -289
- meilisearch_python_sdk-7.5.1/meilisearch_python_sdk/_version.py +0 -1
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/.github/FUNDING.yml +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/.github/release-draft-template.yaml +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/.github/renovate.json5 +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/.github/workflows/docs_publish.yml +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/.github/workflows/nightly_testing.yml +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/.github/workflows/prek_update.yml +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/.github/workflows/pypi_publish.yml +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/.github/workflows/release-drafter.yml +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/.github/workflows/testing.yml +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/.gitignore +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/CONTRIBUTING.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/LICENSE +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/README.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/assets/add_in_batches.png +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/assets/searches.png +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/codecov.yml +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/datasets/small_movies.json +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docker-compose.https.yml +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docker-compose.yml +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/.nojekyll +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/CNAME +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/async_client_api.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/async_index_api.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/client_api.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/css/custom.css +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/decorators_api.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/errors_api.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/index.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/index_api.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/js/umami.js +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/json_handler.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/models_client.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/models_index.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/models_search.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/models_settings.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/models_task.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/overrides/partials/footer.html +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/plugins.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/docs/pydantic.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/.gitignore +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/README.md +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/__init__.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/add_documents_decorator.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/add_documents_in_batches.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/async_add_documents_decorator.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/async_add_documents_in_batches.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/async_documents_and_search_results.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/async_search_tracker.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/async_update_settings.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/documents_and_search_results.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/fastapi_example.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/orjson_example.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/pyproject.toml +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/requirements.txt +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/search_tracker.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/tests/__init__.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/tests/conftest.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/tests/test_async_examples.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/tests/test_examples.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/examples/update_settings.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/justfile +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/__init__.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/_client/__init__.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/_client/_base_client.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/_client/_common.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/_http_requests.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/_utils.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/decorators.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/errors.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/index/__init__.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/index/_common.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/index/async_index.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/index/index.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/json_handler.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/models/__init__.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/models/batch.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/models/client.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/models/documents.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/models/health.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/models/index.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/models/search.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/models/settings.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/models/task.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/models/version.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/models/webhook.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/plugins.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/py.typed +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/types.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/mkdocs.yaml +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/__init__.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/conftest.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/test_async_documents.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/test_async_index.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/test_async_index_plugins.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/test_async_search.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/test_decorators.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/test_documents.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/test_errors.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/test_http_requests.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/test_index.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/test_index_plugins.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/test_json_handler.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/test_search.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/test_settings_models.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/test_utils.py +0 -0
- {meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/tests/test_version.py +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: meilisearch-python-sdk
|
|
3
|
-
Version: 7.5.
|
|
3
|
+
Version: 7.5.2
|
|
4
4
|
Summary: A Python client providing both async and sync support for the Meilisearch API
|
|
5
5
|
Project-URL: repository, https://github.com/sanders41/meilisearch-python-sdk
|
|
6
6
|
Project-URL: homepage, https://github.com/sanders41/meilisearch-python-sdk
|
|
7
7
|
Project-URL: documentation, https://meilisearch-python-sdk.paulsanders.dev
|
|
8
|
+
Project-URL: funding, https://github.com/sponsors/sanders41
|
|
8
9
|
Author-email: Paul Sanders <paul@paulsanders.dev>
|
|
9
10
|
License: MIT License
|
|
10
11
|
|
{meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/_batch.py
RENAMED
|
@@ -41,7 +41,7 @@ async def async_get_batches(
|
|
|
41
41
|
json_handler: JsonHandler,
|
|
42
42
|
uids: list[int] | None = None,
|
|
43
43
|
batch_uids: list[int] | None = None,
|
|
44
|
-
index_uids: list[
|
|
44
|
+
index_uids: list[str] | None = None,
|
|
45
45
|
statuses: list[str] | None = None,
|
|
46
46
|
types: list[str] | None = None,
|
|
47
47
|
limit: int = 20,
|
|
@@ -94,7 +94,7 @@ def get_batches(
|
|
|
94
94
|
json_handler: JsonHandler,
|
|
95
95
|
uids: list[int] | None = None,
|
|
96
96
|
batch_uids: list[int] | None = None,
|
|
97
|
-
index_uids: list[
|
|
97
|
+
index_uids: list[str] | None = None,
|
|
98
98
|
statuses: list[str] | None = None,
|
|
99
99
|
types: list[str] | None = None,
|
|
100
100
|
limit: int = 20,
|
|
@@ -131,7 +131,7 @@ def _build_parameters(
|
|
|
131
131
|
*,
|
|
132
132
|
uids: list[int] | None = None,
|
|
133
133
|
batch_uids: list[int] | None = None,
|
|
134
|
-
index_uids: list[
|
|
134
|
+
index_uids: list[str] | None = None,
|
|
135
135
|
statuses: list[str] | None = None,
|
|
136
136
|
types: list[str] | None = None,
|
|
137
137
|
limit: int = 20,
|
|
@@ -895,7 +895,7 @@ class AsyncClient(BaseClient):
|
|
|
895
895
|
*,
|
|
896
896
|
uids: list[int] | None = None,
|
|
897
897
|
batch_uids: list[int] | None = None,
|
|
898
|
-
index_uids: list[
|
|
898
|
+
index_uids: list[str] | None = None,
|
|
899
899
|
statuses: list[str] | None = None,
|
|
900
900
|
types: list[str] | None = None,
|
|
901
901
|
limit: int = 20,
|
|
@@ -927,7 +927,7 @@ class AsyncClient(BaseClient):
|
|
|
927
927
|
self,
|
|
928
928
|
*,
|
|
929
929
|
uids: list[int] | None = None,
|
|
930
|
-
index_uids: list[
|
|
930
|
+
index_uids: list[str] | None = None,
|
|
931
931
|
statuses: list[str] | None = None,
|
|
932
932
|
types: list[str] | None = None,
|
|
933
933
|
before_enqueued_at: datetime | None = None,
|
|
@@ -1005,7 +1005,7 @@ class AsyncClient(BaseClient):
|
|
|
1005
1005
|
self,
|
|
1006
1006
|
*,
|
|
1007
1007
|
uids: list[int] | None = None,
|
|
1008
|
-
index_uids: list[
|
|
1008
|
+
index_uids: list[str] | None = None,
|
|
1009
1009
|
statuses: list[str] | None = None,
|
|
1010
1010
|
types: list[str] | None = None,
|
|
1011
1011
|
before_enqueued_at: datetime | None = None,
|
|
@@ -1061,6 +1061,18 @@ class AsyncClient(BaseClient):
|
|
|
1061
1061
|
index_ids: list[str] | None = None,
|
|
1062
1062
|
types: str | list[str] | None = None,
|
|
1063
1063
|
reverse: bool | None = None,
|
|
1064
|
+
uids: list[int] | None = None,
|
|
1065
|
+
batch_uids: list[int] | None = None,
|
|
1066
|
+
canceled_by: list[int] | None = None,
|
|
1067
|
+
statuses: str | list[str] | None = None,
|
|
1068
|
+
before_enqueued_at: datetime | None = None,
|
|
1069
|
+
after_enqueued_at: datetime | None = None,
|
|
1070
|
+
before_started_at: datetime | None = None,
|
|
1071
|
+
after_started_at: datetime | None = None,
|
|
1072
|
+
before_finished_at: datetime | None = None,
|
|
1073
|
+
after_finished_at: datetime | None = None,
|
|
1074
|
+
limit: int | None = None,
|
|
1075
|
+
from_: int | None = None,
|
|
1064
1076
|
) -> TaskStatus:
|
|
1065
1077
|
"""Get multiple tasks.
|
|
1066
1078
|
|
|
@@ -1069,6 +1081,24 @@ class AsyncClient(BaseClient):
|
|
|
1069
1081
|
tasks only for the specified indexes, if not all tasks will be returned. Default = None
|
|
1070
1082
|
types: Specify specific task types to retrieve. Default = None
|
|
1071
1083
|
reverse: If True the tasks will be returned in reverse order. Default = None
|
|
1084
|
+
uids: A list of task UIDs to retrieve. Default = None
|
|
1085
|
+
batch_uids: A list of batch UIDs for which to get the tasks. Default = None
|
|
1086
|
+
canceled_by: A list of task UIDs that canceled the tasks to retrieve. Default = None
|
|
1087
|
+
statuses: Specify specific task statuses to retrieve. Default = None
|
|
1088
|
+
before_enqueued_at: Get tasks that were enqueued before the specified date time.
|
|
1089
|
+
Default = None
|
|
1090
|
+
after_enqueued_at: Get tasks that were enqueued after the specified date time.
|
|
1091
|
+
Default = None
|
|
1092
|
+
before_started_at: Get tasks that were started before the specified date time.
|
|
1093
|
+
Default = None
|
|
1094
|
+
after_started_at: Get tasks that were started after the specified date time.
|
|
1095
|
+
Default = None
|
|
1096
|
+
before_finished_at: Get tasks that were finished before the specified date time.
|
|
1097
|
+
Default = None
|
|
1098
|
+
after_finished_at: Get tasks that were finished after the specified date time.
|
|
1099
|
+
Default = None
|
|
1100
|
+
limit: The maximum number of tasks to return. Default = None
|
|
1101
|
+
from_: The task UID from which to start returning tasks. Default = None
|
|
1072
1102
|
|
|
1073
1103
|
Returns:
|
|
1074
1104
|
Task statuses.
|
|
@@ -1090,6 +1120,18 @@ class AsyncClient(BaseClient):
|
|
|
1090
1120
|
index_ids=index_ids,
|
|
1091
1121
|
types=types,
|
|
1092
1122
|
reverse=reverse,
|
|
1123
|
+
uids=uids,
|
|
1124
|
+
batch_uids=batch_uids,
|
|
1125
|
+
canceled_by=canceled_by,
|
|
1126
|
+
statuses=statuses,
|
|
1127
|
+
before_enqueued_at=before_enqueued_at,
|
|
1128
|
+
after_enqueued_at=after_enqueued_at,
|
|
1129
|
+
before_started_at=before_started_at,
|
|
1130
|
+
after_started_at=after_started_at,
|
|
1131
|
+
before_finished_at=before_finished_at,
|
|
1132
|
+
after_finished_at=after_finished_at,
|
|
1133
|
+
limit=limit,
|
|
1134
|
+
from_=from_,
|
|
1093
1135
|
)
|
|
1094
1136
|
|
|
1095
1137
|
async def wait_for_task(
|
|
@@ -1177,7 +1219,7 @@ class AsyncClient(BaseClient):
|
|
|
1177
1219
|
"""
|
|
1178
1220
|
payload = build_transfer_documents_payload(url, api_key, payload_size, indexes)
|
|
1179
1221
|
|
|
1180
|
-
response = await self._http_requests.post(
|
|
1222
|
+
response = await self._http_requests.post("export", body=payload)
|
|
1181
1223
|
|
|
1182
1224
|
return TaskInfo(**self._http_requests.parse_json(response))
|
|
1183
1225
|
|
|
@@ -897,7 +897,7 @@ class Client(BaseClient):
|
|
|
897
897
|
*,
|
|
898
898
|
uids: list[int] | None = None,
|
|
899
899
|
batch_uids: list[int] | None = None,
|
|
900
|
-
index_uids: list[
|
|
900
|
+
index_uids: list[str] | None = None,
|
|
901
901
|
statuses: list[str] | None = None,
|
|
902
902
|
types: list[str] | None = None,
|
|
903
903
|
limit: int = 20,
|
|
@@ -929,7 +929,7 @@ class Client(BaseClient):
|
|
|
929
929
|
self,
|
|
930
930
|
*,
|
|
931
931
|
uids: list[int] | None = None,
|
|
932
|
-
index_uids: list[
|
|
932
|
+
index_uids: list[str] | None = None,
|
|
933
933
|
statuses: list[str] | None = None,
|
|
934
934
|
types: list[str] | None = None,
|
|
935
935
|
before_enqueued_at: datetime | None = None,
|
|
@@ -983,7 +983,7 @@ class Client(BaseClient):
|
|
|
983
983
|
self,
|
|
984
984
|
*,
|
|
985
985
|
uids: list[int] | None = None,
|
|
986
|
-
index_uids: list[
|
|
986
|
+
index_uids: list[str] | None = None,
|
|
987
987
|
statuses: list[str] | None = None,
|
|
988
988
|
types: list[str] | None = None,
|
|
989
989
|
before_enqueued_at: datetime | None = None,
|
|
@@ -1060,6 +1060,18 @@ class Client(BaseClient):
|
|
|
1060
1060
|
index_ids: list[str] | None = None,
|
|
1061
1061
|
types: str | list[str] | None = None,
|
|
1062
1062
|
reverse: bool | None = None,
|
|
1063
|
+
uids: list[int] | None = None,
|
|
1064
|
+
batch_uids: list[int] | None = None,
|
|
1065
|
+
canceled_by: list[int] | None = None,
|
|
1066
|
+
statuses: str | list[str] | None = None,
|
|
1067
|
+
before_enqueued_at: datetime | None = None,
|
|
1068
|
+
after_enqueued_at: datetime | None = None,
|
|
1069
|
+
before_started_at: datetime | None = None,
|
|
1070
|
+
after_started_at: datetime | None = None,
|
|
1071
|
+
before_finished_at: datetime | None = None,
|
|
1072
|
+
after_finished_at: datetime | None = None,
|
|
1073
|
+
limit: int | None = None,
|
|
1074
|
+
from_: int | None = None,
|
|
1063
1075
|
) -> TaskStatus:
|
|
1064
1076
|
"""Get multiple tasks.
|
|
1065
1077
|
|
|
@@ -1068,6 +1080,24 @@ class Client(BaseClient):
|
|
|
1068
1080
|
tasks only for the specified indexes, if not all tasks will be returned. Default = None
|
|
1069
1081
|
types: Specify specific task types to retrieve. Default = None
|
|
1070
1082
|
reverse: If True the tasks will be returned in reverse order. Default = None
|
|
1083
|
+
uids: A list of task UIDs to retrieve. Default = None
|
|
1084
|
+
batch_uids: A list of batch UIDs for which to get the tasks. Default = None
|
|
1085
|
+
canceled_by: A list of task UIDs that canceled the tasks to retrieve. Default = None
|
|
1086
|
+
statuses: Specify specific task statuses to retrieve. Default = None
|
|
1087
|
+
before_enqueued_at: Get tasks that were enqueued before the specified date time.
|
|
1088
|
+
Default = None
|
|
1089
|
+
after_enqueued_at: Get tasks that were enqueued after the specified date time.
|
|
1090
|
+
Default = None
|
|
1091
|
+
before_started_at: Get tasks that were started before the specified date time.
|
|
1092
|
+
Default = None
|
|
1093
|
+
after_started_at: Get tasks that were started after the specified date time.
|
|
1094
|
+
Default = None
|
|
1095
|
+
before_finished_at: Get tasks that were finished before the specified date time.
|
|
1096
|
+
Default = None
|
|
1097
|
+
after_finished_at: Get tasks that were finished after the specified date time.
|
|
1098
|
+
Default = None
|
|
1099
|
+
limit: The maximum number of tasks to return. Default = None
|
|
1100
|
+
from_: The task UID from which to start returning tasks. Default = None
|
|
1071
1101
|
|
|
1072
1102
|
Returns:
|
|
1073
1103
|
Task statuses.
|
|
@@ -1089,6 +1119,18 @@ class Client(BaseClient):
|
|
|
1089
1119
|
index_ids=index_ids,
|
|
1090
1120
|
types=types,
|
|
1091
1121
|
reverse=reverse,
|
|
1122
|
+
uids=uids,
|
|
1123
|
+
batch_uids=batch_uids,
|
|
1124
|
+
canceled_by=canceled_by,
|
|
1125
|
+
statuses=statuses,
|
|
1126
|
+
before_enqueued_at=before_enqueued_at,
|
|
1127
|
+
after_enqueued_at=after_enqueued_at,
|
|
1128
|
+
before_started_at=before_started_at,
|
|
1129
|
+
after_started_at=after_started_at,
|
|
1130
|
+
before_finished_at=before_finished_at,
|
|
1131
|
+
after_finished_at=after_finished_at,
|
|
1132
|
+
limit=limit,
|
|
1133
|
+
from_=from_,
|
|
1092
1134
|
)
|
|
1093
1135
|
|
|
1094
1136
|
def wait_for_task(
|
|
@@ -1174,7 +1216,7 @@ class Client(BaseClient):
|
|
|
1174
1216
|
"""
|
|
1175
1217
|
payload = build_transfer_documents_payload(url, api_key, payload_size, indexes)
|
|
1176
1218
|
|
|
1177
|
-
response = self._http_requests.post(
|
|
1219
|
+
response = self._http_requests.post("export", body=payload)
|
|
1178
1220
|
|
|
1179
1221
|
return TaskInfo(**self._http_requests.parse_json(response))
|
|
1180
1222
|
|
{meilisearch_python_sdk-7.5.1 → meilisearch_python_sdk-7.5.2}/meilisearch_python_sdk/_task.py
RENAMED
|
@@ -24,7 +24,7 @@ async def async_cancel_tasks(
|
|
|
24
24
|
*,
|
|
25
25
|
json_handler: JsonHandler,
|
|
26
26
|
uids: list[int] | None = None,
|
|
27
|
-
index_uids: list[
|
|
27
|
+
index_uids: list[str] | None = None,
|
|
28
28
|
statuses: list[str] | None = None,
|
|
29
29
|
types: list[str] | None = None,
|
|
30
30
|
before_enqueued_at: datetime | None = None,
|
|
@@ -63,14 +63,14 @@ async def async_cancel_tasks(
|
|
|
63
63
|
>>> await cancel_tasks(client, uids=[1, 2])
|
|
64
64
|
"""
|
|
65
65
|
parameters = _process_params(
|
|
66
|
-
uids,
|
|
67
|
-
index_uids,
|
|
68
|
-
statuses,
|
|
69
|
-
types,
|
|
70
|
-
before_enqueued_at,
|
|
71
|
-
after_enqueued_at,
|
|
72
|
-
before_started_at,
|
|
73
|
-
after_finished_at,
|
|
66
|
+
uids=uids,
|
|
67
|
+
index_uids=index_uids,
|
|
68
|
+
statuses=statuses,
|
|
69
|
+
types=types,
|
|
70
|
+
before_enqueued_at=before_enqueued_at,
|
|
71
|
+
after_enqueued_at=after_enqueued_at,
|
|
72
|
+
before_started_at=before_started_at,
|
|
73
|
+
after_finished_at=after_finished_at,
|
|
74
74
|
)
|
|
75
75
|
|
|
76
76
|
if not parameters:
|
|
@@ -90,7 +90,7 @@ async def async_delete_tasks(
|
|
|
90
90
|
*,
|
|
91
91
|
json_handler: JsonHandler,
|
|
92
92
|
uids: list[int] | None = None,
|
|
93
|
-
index_uids: list[
|
|
93
|
+
index_uids: list[str] | None = None,
|
|
94
94
|
statuses: list[str] | None = None,
|
|
95
95
|
types: list[str] | None = None,
|
|
96
96
|
before_enqueued_at: datetime | None = None,
|
|
@@ -99,14 +99,14 @@ async def async_delete_tasks(
|
|
|
99
99
|
after_finished_at: datetime | None = None,
|
|
100
100
|
) -> TaskInfo:
|
|
101
101
|
parameters = _process_params(
|
|
102
|
-
uids,
|
|
103
|
-
index_uids,
|
|
104
|
-
statuses,
|
|
105
|
-
types,
|
|
106
|
-
before_enqueued_at,
|
|
107
|
-
after_enqueued_at,
|
|
108
|
-
before_started_at,
|
|
109
|
-
after_finished_at,
|
|
102
|
+
uids=uids,
|
|
103
|
+
index_uids=index_uids,
|
|
104
|
+
statuses=statuses,
|
|
105
|
+
types=types,
|
|
106
|
+
before_enqueued_at=before_enqueued_at,
|
|
107
|
+
after_enqueued_at=after_enqueued_at,
|
|
108
|
+
before_started_at=before_started_at,
|
|
109
|
+
after_finished_at=after_finished_at,
|
|
110
110
|
)
|
|
111
111
|
|
|
112
112
|
if not parameters:
|
|
@@ -140,17 +140,37 @@ async def async_get_tasks(
|
|
|
140
140
|
index_ids: list[str] | None = None,
|
|
141
141
|
types: str | list[str] | None = None,
|
|
142
142
|
reverse: bool | None = None,
|
|
143
|
+
uids: list[int] | None = None,
|
|
144
|
+
batch_uids: list[int] | None = None,
|
|
145
|
+
canceled_by: list[int] | None = None,
|
|
146
|
+
statuses: str | list[str] | None = None,
|
|
147
|
+
before_enqueued_at: datetime | None = None,
|
|
148
|
+
after_enqueued_at: datetime | None = None,
|
|
149
|
+
before_started_at: datetime | None = None,
|
|
150
|
+
after_started_at: datetime | None = None,
|
|
151
|
+
before_finished_at: datetime | None = None,
|
|
152
|
+
after_finished_at: datetime | None = None,
|
|
153
|
+
limit: int | None = None,
|
|
154
|
+
from_: int | None = None,
|
|
143
155
|
) -> TaskStatus:
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
156
|
+
parameters = _process_params(
|
|
157
|
+
uids=uids,
|
|
158
|
+
index_uids=index_ids,
|
|
159
|
+
statuses=statuses,
|
|
160
|
+
types=types,
|
|
161
|
+
before_enqueued_at=before_enqueued_at,
|
|
162
|
+
after_enqueued_at=after_enqueued_at,
|
|
163
|
+
before_started_at=before_started_at,
|
|
164
|
+
after_finished_at=after_finished_at,
|
|
165
|
+
batch_uids=batch_uids,
|
|
166
|
+
canceled_by=canceled_by,
|
|
167
|
+
after_started_at=after_started_at,
|
|
168
|
+
before_finished_at=before_finished_at,
|
|
169
|
+
limit=limit,
|
|
170
|
+
from_=from_,
|
|
171
|
+
reverse=reverse,
|
|
172
|
+
)
|
|
173
|
+
url = f"tasks?{urlencode(parameters)}" if parameters else "tasks"
|
|
154
174
|
client_ = get_async_client(client)
|
|
155
175
|
http_requests = AsyncHttpRequests(client_, json_handler)
|
|
156
176
|
response = await http_requests.get(url)
|
|
@@ -203,7 +223,7 @@ def cancel_tasks(
|
|
|
203
223
|
*,
|
|
204
224
|
json_handler: JsonHandler,
|
|
205
225
|
uids: list[int] | None = None,
|
|
206
|
-
index_uids: list[
|
|
226
|
+
index_uids: list[str] | None = None,
|
|
207
227
|
statuses: list[str] | None = None,
|
|
208
228
|
types: list[str] | None = None,
|
|
209
229
|
before_enqueued_at: datetime | None = None,
|
|
@@ -212,14 +232,14 @@ def cancel_tasks(
|
|
|
212
232
|
after_finished_at: datetime | None = None,
|
|
213
233
|
) -> TaskInfo:
|
|
214
234
|
parameters = _process_params(
|
|
215
|
-
uids,
|
|
216
|
-
index_uids,
|
|
217
|
-
statuses,
|
|
218
|
-
types,
|
|
219
|
-
before_enqueued_at,
|
|
220
|
-
after_enqueued_at,
|
|
221
|
-
before_started_at,
|
|
222
|
-
after_finished_at,
|
|
235
|
+
uids=uids,
|
|
236
|
+
index_uids=index_uids,
|
|
237
|
+
statuses=statuses,
|
|
238
|
+
types=types,
|
|
239
|
+
before_enqueued_at=before_enqueued_at,
|
|
240
|
+
after_enqueued_at=after_enqueued_at,
|
|
241
|
+
before_started_at=before_started_at,
|
|
242
|
+
after_finished_at=after_finished_at,
|
|
223
243
|
)
|
|
224
244
|
|
|
225
245
|
if not parameters:
|
|
@@ -239,7 +259,7 @@ def delete_tasks(
|
|
|
239
259
|
*,
|
|
240
260
|
json_handler: JsonHandler,
|
|
241
261
|
uids: list[int] | None = None,
|
|
242
|
-
index_uids: list[
|
|
262
|
+
index_uids: list[str] | None = None,
|
|
243
263
|
statuses: list[str] | None = None,
|
|
244
264
|
types: list[str] | None = None,
|
|
245
265
|
before_enqueued_at: datetime | None = None,
|
|
@@ -248,14 +268,14 @@ def delete_tasks(
|
|
|
248
268
|
after_finished_at: datetime | None = None,
|
|
249
269
|
) -> TaskInfo:
|
|
250
270
|
parameters = _process_params(
|
|
251
|
-
uids,
|
|
252
|
-
index_uids,
|
|
253
|
-
statuses,
|
|
254
|
-
types,
|
|
255
|
-
before_enqueued_at,
|
|
256
|
-
after_enqueued_at,
|
|
257
|
-
before_started_at,
|
|
258
|
-
after_finished_at,
|
|
271
|
+
uids=uids,
|
|
272
|
+
index_uids=index_uids,
|
|
273
|
+
statuses=statuses,
|
|
274
|
+
types=types,
|
|
275
|
+
before_enqueued_at=before_enqueued_at,
|
|
276
|
+
after_enqueued_at=after_enqueued_at,
|
|
277
|
+
before_started_at=before_started_at,
|
|
278
|
+
after_finished_at=after_finished_at,
|
|
259
279
|
)
|
|
260
280
|
|
|
261
281
|
if not parameters:
|
|
@@ -285,17 +305,37 @@ def get_tasks(
|
|
|
285
305
|
index_ids: list[str] | None = None,
|
|
286
306
|
types: str | list[str] | None = None,
|
|
287
307
|
reverse: bool | None = None,
|
|
308
|
+
uids: list[int] | None = None,
|
|
309
|
+
batch_uids: list[int] | None = None,
|
|
310
|
+
canceled_by: list[int] | None = None,
|
|
311
|
+
statuses: str | list[str] | None = None,
|
|
312
|
+
before_enqueued_at: datetime | None = None,
|
|
313
|
+
after_enqueued_at: datetime | None = None,
|
|
314
|
+
before_started_at: datetime | None = None,
|
|
315
|
+
after_started_at: datetime | None = None,
|
|
316
|
+
before_finished_at: datetime | None = None,
|
|
317
|
+
after_finished_at: datetime | None = None,
|
|
318
|
+
limit: int | None = None,
|
|
319
|
+
from_: int | None = None,
|
|
288
320
|
) -> TaskStatus:
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
321
|
+
parameters = _process_params(
|
|
322
|
+
uids=uids,
|
|
323
|
+
index_uids=index_ids,
|
|
324
|
+
statuses=statuses,
|
|
325
|
+
types=types,
|
|
326
|
+
before_enqueued_at=before_enqueued_at,
|
|
327
|
+
after_enqueued_at=after_enqueued_at,
|
|
328
|
+
before_started_at=before_started_at,
|
|
329
|
+
after_finished_at=after_finished_at,
|
|
330
|
+
batch_uids=batch_uids,
|
|
331
|
+
canceled_by=canceled_by,
|
|
332
|
+
after_started_at=after_started_at,
|
|
333
|
+
before_finished_at=before_finished_at,
|
|
334
|
+
limit=limit,
|
|
335
|
+
from_=from_,
|
|
336
|
+
reverse=reverse,
|
|
337
|
+
)
|
|
338
|
+
url = f"tasks?{urlencode(parameters)}" if parameters else "tasks"
|
|
299
339
|
client_ = get_client(client)
|
|
300
340
|
http_requests = HttpRequests(client_, json_handler)
|
|
301
341
|
response = http_requests.get(url)
|
|
@@ -343,32 +383,60 @@ def wait_for_task(
|
|
|
343
383
|
time.sleep(interval_in_ms / 1000)
|
|
344
384
|
|
|
345
385
|
|
|
386
|
+
def _join_values(values: str | list[str] | list[int]) -> str:
|
|
387
|
+
if isinstance(values, str):
|
|
388
|
+
return values
|
|
389
|
+
|
|
390
|
+
return ",".join([str(x) for x in values])
|
|
391
|
+
|
|
392
|
+
|
|
346
393
|
def _process_params(
|
|
347
394
|
uids: list[int] | None = None,
|
|
348
|
-
index_uids: list[
|
|
349
|
-
statuses: list[str] | None = None,
|
|
350
|
-
types: list[str] | None = None,
|
|
395
|
+
index_uids: list[str] | None = None,
|
|
396
|
+
statuses: str | list[str] | None = None,
|
|
397
|
+
types: str | list[str] | None = None,
|
|
351
398
|
before_enqueued_at: datetime | None = None,
|
|
352
399
|
after_enqueued_at: datetime | None = None,
|
|
353
400
|
before_started_at: datetime | None = None,
|
|
354
401
|
after_finished_at: datetime | None = None,
|
|
402
|
+
batch_uids: list[int] | None = None,
|
|
403
|
+
canceled_by: list[int] | None = None,
|
|
404
|
+
after_started_at: datetime | None = None,
|
|
405
|
+
before_finished_at: datetime | None = None,
|
|
406
|
+
limit: int | None = None,
|
|
407
|
+
from_: int | None = None,
|
|
408
|
+
reverse: bool | None = None,
|
|
355
409
|
) -> dict[str, str]:
|
|
356
410
|
parameters = {}
|
|
357
411
|
if uids:
|
|
358
|
-
parameters["uids"] =
|
|
412
|
+
parameters["uids"] = _join_values(uids)
|
|
413
|
+
if batch_uids:
|
|
414
|
+
parameters["batchUids"] = _join_values(batch_uids)
|
|
359
415
|
if index_uids:
|
|
360
|
-
parameters["indexUids"] =
|
|
416
|
+
parameters["indexUids"] = _join_values(index_uids)
|
|
417
|
+
if canceled_by:
|
|
418
|
+
parameters["canceledBy"] = _join_values(canceled_by)
|
|
361
419
|
if statuses:
|
|
362
|
-
parameters["statuses"] =
|
|
420
|
+
parameters["statuses"] = _join_values(statuses)
|
|
363
421
|
if types:
|
|
364
|
-
parameters["types"] =
|
|
422
|
+
parameters["types"] = _join_values(types)
|
|
365
423
|
if before_enqueued_at:
|
|
366
424
|
parameters["beforeEnqueuedAt"] = f"{before_enqueued_at.isoformat()}Z"
|
|
367
425
|
if after_enqueued_at:
|
|
368
426
|
parameters["afterEnqueuedAt"] = f"{after_enqueued_at.isoformat()}Z"
|
|
369
427
|
if before_started_at:
|
|
370
428
|
parameters["beforeStartedAt"] = f"{before_started_at.isoformat()}Z"
|
|
429
|
+
if after_started_at:
|
|
430
|
+
parameters["afterStartedAt"] = f"{after_started_at.isoformat()}Z"
|
|
431
|
+
if before_finished_at:
|
|
432
|
+
parameters["beforeFinishedAt"] = f"{before_finished_at.isoformat()}Z"
|
|
371
433
|
if after_finished_at:
|
|
372
434
|
parameters["afterFinishedAt"] = f"{after_finished_at.isoformat()}Z"
|
|
435
|
+
if limit is not None:
|
|
436
|
+
parameters["limit"] = str(limit)
|
|
437
|
+
if from_ is not None:
|
|
438
|
+
parameters["from"] = str(from_)
|
|
439
|
+
if reverse is not None:
|
|
440
|
+
parameters["reverse"] = str(reverse).lower()
|
|
373
441
|
|
|
374
442
|
return parameters
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = "7.5.2"
|
|
@@ -34,7 +34,7 @@ hooks = [
|
|
|
34
34
|
|
|
35
35
|
[[repos]]
|
|
36
36
|
repo = "https://github.com/astral-sh/ruff-pre-commit"
|
|
37
|
-
rev = "v0.16.
|
|
37
|
+
rev = "v0.16.5"
|
|
38
38
|
hooks = [
|
|
39
39
|
{
|
|
40
40
|
id = "ruff-check",
|
|
@@ -47,7 +47,7 @@ hooks = [
|
|
|
47
47
|
|
|
48
48
|
[[repos]]
|
|
49
49
|
repo = "https://github.com/rvben/rumdl-pre-commit"
|
|
50
|
-
rev = "v0.2.
|
|
50
|
+
rev = "v0.2.62"
|
|
51
51
|
hooks = [
|
|
52
52
|
{ id = "rumdl-fmt" }
|
|
53
53
|
]
|
|
@@ -42,8 +42,8 @@ dev = [
|
|
|
42
42
|
"pytest-cov==7.1.0",
|
|
43
43
|
"pytest-asyncio==1.4.0",
|
|
44
44
|
"pytest-xdist==3.8.0",
|
|
45
|
-
"prek==0.
|
|
46
|
-
"ruff==0.16.
|
|
45
|
+
"prek==0.5.1",
|
|
46
|
+
"ruff==0.16.5",
|
|
47
47
|
"types-aiofiles==25.1.0.20260518",
|
|
48
48
|
"typing-extensions==4.16.0",
|
|
49
49
|
"zensical==0.0.57",
|
|
@@ -56,6 +56,7 @@ path = "meilisearch_python_sdk/_version.py"
|
|
|
56
56
|
repository = "https://github.com/sanders41/meilisearch-python-sdk"
|
|
57
57
|
homepage = "https://github.com/sanders41/meilisearch-python-sdk"
|
|
58
58
|
documentation = "https://meilisearch-python-sdk.paulsanders.dev"
|
|
59
|
+
funding = "https://github.com/sponsors/sanders41"
|
|
59
60
|
|
|
60
61
|
[tool.pytest.ini_options]
|
|
61
62
|
minversion = "6.0"
|
|
@@ -974,6 +974,90 @@ async def test_get_tasks_for_index_reverse(async_client, async_empty_index, smal
|
|
|
974
974
|
assert next(iter(uid)) == index.uid
|
|
975
975
|
|
|
976
976
|
|
|
977
|
+
@pytest.mark.usefixtures("create_tasks")
|
|
978
|
+
@pytest.mark.no_parallel
|
|
979
|
+
async def test_get_tasks_canceled_by(async_client):
|
|
980
|
+
task = await async_client.cancel_tasks(statuses=["enqueued", "processing"])
|
|
981
|
+
await async_client.wait_for_task(task.task_uid)
|
|
982
|
+
all_tasks = await async_client.get_tasks(limit=1000)
|
|
983
|
+
expected = [x.uid for x in all_tasks.results if x.canceled_by == task.task_uid]
|
|
984
|
+
|
|
985
|
+
result = await async_client.get_tasks(canceled_by=[task.task_uid])
|
|
986
|
+
|
|
987
|
+
assert sorted(x.uid for x in result.results) == sorted(expected)
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
@pytest.mark.no_parallel
|
|
991
|
+
async def test_get_tasks_limit_zero(async_client, async_empty_index, small_movies):
|
|
992
|
+
index = await async_empty_index()
|
|
993
|
+
response = await index.add_documents(small_movies)
|
|
994
|
+
await async_client.wait_for_task(response.task_uid)
|
|
995
|
+
|
|
996
|
+
result = await async_client.get_tasks(limit=0)
|
|
997
|
+
|
|
998
|
+
assert result.limit == 0
|
|
999
|
+
assert result.results == []
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
@pytest.mark.no_parallel
|
|
1003
|
+
async def test_get_tasks_pagination(async_client, async_empty_index, small_movies):
|
|
1004
|
+
index = await async_empty_index()
|
|
1005
|
+
response = await index.add_documents(small_movies)
|
|
1006
|
+
await async_client.wait_for_task(response.task_uid)
|
|
1007
|
+
|
|
1008
|
+
limited = await async_client.get_tasks(limit=2)
|
|
1009
|
+
|
|
1010
|
+
assert len(limited.results) <= 2
|
|
1011
|
+
assert limited.limit == 2
|
|
1012
|
+
|
|
1013
|
+
paged = await async_client.get_tasks(limit=1, from_=limited.results[0].uid)
|
|
1014
|
+
|
|
1015
|
+
assert len(paged.results) == 1
|
|
1016
|
+
assert paged.results[0].uid == limited.results[0].uid
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
@pytest.mark.no_parallel
|
|
1020
|
+
async def test_get_tasks_filters(async_client, async_empty_index, small_movies):
|
|
1021
|
+
index = await async_empty_index()
|
|
1022
|
+
response = await index.add_documents(small_movies)
|
|
1023
|
+
task = await async_client.wait_for_task(response.task_uid)
|
|
1024
|
+
|
|
1025
|
+
by_uid = await async_client.get_tasks(uids=[task.uid])
|
|
1026
|
+
|
|
1027
|
+
assert [x.uid for x in by_uid.results] == [task.uid]
|
|
1028
|
+
|
|
1029
|
+
by_status = await async_client.get_tasks(uids=[task.uid], statuses=["succeeded"])
|
|
1030
|
+
|
|
1031
|
+
assert [x.uid for x in by_status.results] == [task.uid]
|
|
1032
|
+
|
|
1033
|
+
by_batch = await async_client.get_tasks(batch_uids=[task.batch_uid])
|
|
1034
|
+
|
|
1035
|
+
assert task.uid in [x.uid for x in by_batch.results]
|
|
1036
|
+
|
|
1037
|
+
excluded = await async_client.get_tasks(uids=[task.uid], statuses=["failed"])
|
|
1038
|
+
|
|
1039
|
+
assert excluded.results == []
|
|
1040
|
+
|
|
1041
|
+
|
|
1042
|
+
@pytest.mark.no_parallel
|
|
1043
|
+
async def test_get_tasks_date_filters(async_client, async_empty_index, small_movies):
|
|
1044
|
+
index = await async_empty_index()
|
|
1045
|
+
response = await index.add_documents(small_movies)
|
|
1046
|
+
task = await async_client.wait_for_task(response.task_uid)
|
|
1047
|
+
future = datetime(2100, 1, 1)
|
|
1048
|
+
past = datetime(2000, 1, 1)
|
|
1049
|
+
|
|
1050
|
+
before_hit = await async_client.get_tasks(uids=[task.uid], before_finished_at=future)
|
|
1051
|
+
before_miss = await async_client.get_tasks(uids=[task.uid], before_finished_at=past)
|
|
1052
|
+
after_hit = await async_client.get_tasks(uids=[task.uid], after_started_at=past)
|
|
1053
|
+
after_miss = await async_client.get_tasks(uids=[task.uid], after_started_at=future)
|
|
1054
|
+
|
|
1055
|
+
assert [x.uid for x in before_hit.results] == [task.uid]
|
|
1056
|
+
assert before_miss.results == []
|
|
1057
|
+
assert [x.uid for x in after_hit.results] == [task.uid]
|
|
1058
|
+
assert after_miss.results == []
|
|
1059
|
+
|
|
1060
|
+
|
|
977
1061
|
@pytest.mark.no_parallel
|
|
978
1062
|
async def test_get_task(async_client, async_empty_index, small_movies):
|
|
979
1063
|
index = await async_empty_index()
|