-
Notifications
You must be signed in to change notification settings - Fork 90
Add task cancel API for v0.30.0 #596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add task cancel API for v0.30.0 #596
Conversation
acb9cc5
to
3ead4e1
Compare
e5fd493
to
6dd53c9
Compare
cba795a
to
57f3953
Compare
57f3953
to
3f170d1
Compare
f13edf8
to
fd481df
Compare
dee4333
to
c54dbf0
Compare
fd481df
to
b8a1aa1
Compare
835f9d6
to
b9af137
Compare
b9af137
to
df03c15
Compare
df03c15
to
010eb99
Compare
Co-authored-by: Paul Sanders <[email protected]>
Co-authored-by: Paul Sanders <[email protected]>
Co-authored-by: Paul Sanders <[email protected]>
@@ -11,7 +11,8 @@ class Task(CamelBase): | |||
status: str | |||
type: str | |||
details: Dict[str, Any] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In another PR, this should be changed to Union[Dict[str, Any], None]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
714465a
to
12569d9
Compare
That would work. There is also another option to keep it a function that would be simpler and require no change in the task module while still making things clear. from meilisearch import task
def get_task(self, uid: int) -> Task:
# ...
task = task.get_task(x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This suggestion is because I just ran into this issue updating the async python client. The current cancel task tests assume other tests have already run and generated tasks. On first starting the server, if a cancel task test is run first it will error because no tasks have been created yet. This fixture creates some tasks to prevent that.
Co-authored-by: Paul Sanders <[email protected]>
Co-authored-by: Paul Sanders <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🔥
588: Changes related to the next Meilisearch release (v0.30.0) r=alallema a=meili-bot Related to this issue: meilisearch/integration-guides#221 This PR: - gathers the changes related to the next Meilisearch release (v0.30.0) so that this package is ready when the official release is out. - should pass the tests against the [latest pre-release of Meilisearch](https://github.com/meilisearch/meilisearch/releases). - might eventually contain test failures until the Meilisearch v0.30.0 is out.⚠️ This PR should NOT be merged until the next release of Meilisearch (v0.30.0) is out. _This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/main/resources/pre-release-week.md) purpose._ - #597 - #595 - #596 - #598 - #603 Co-authored-by: meili-bot <[email protected]> Co-authored-by: alallema <[email protected]> Co-authored-by: Amélie <[email protected]>
588: Changes related to the next Meilisearch release (v0.30.0) r=alallema a=meili-bot Related to this issue: meilisearch/integration-guides#221 This PR: - gathers the changes related to the next Meilisearch release (v0.30.0) so that this package is ready when the official release is out. - should pass the tests against the [latest pre-release of Meilisearch](https://github.com/meilisearch/meilisearch/releases). - might eventually contain test failures until the Meilisearch v0.30.0 is out.⚠️ This PR should NOT be merged until the next release of Meilisearch (v0.30.0) is out. _This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/main/resources/pre-release-week.md) purpose._ - #597 - #595 - #596 - #598 - #603 Co-authored-by: meili-bot <[email protected]> Co-authored-by: alallema <[email protected]> Co-authored-by: Amélie <[email protected]>
Add the cancel task API see spec
Enhancement
It is now possible to delete your tasks:
example:
TODO
canceled_by
in Task classerror
in Task classcancel_tasks()
index_uid
is now optionaluid