From 0733ebb2238ccfdd411588471c4fc27984401203 Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Tue, 25 Feb 2025 11:22:15 +0530 Subject: [PATCH 1/2] Removing "cancelled" response --- arango/job.py | 3 +-- docs/async.rst | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/arango/job.py b/arango/job.py index d5065d04..6e664763 100644 --- a/arango/job.py +++ b/arango/job.py @@ -60,8 +60,7 @@ def status(self) -> str: fail. :return: Async job status. Possible values are "pending" (job is still - in queue), "done" (job finished or raised an error), or "cancelled" - (job was cancelled before completion). + in queue), "done" (job finished or raised an error). :rtype: str :raise arango.exceptions.AsyncJobStatusError: If retrieval fails. """ diff --git a/docs/async.rst b/docs/async.rst index 82690b29..5e480248 100644 --- a/docs/async.rst +++ b/docs/async.rst @@ -45,8 +45,8 @@ the results can be retrieved once available via :ref:`AsyncJob` objects. # Retrieve the status of each async job. for job in [job1, job2, job3, job4]: - # Job status can be "pending", "done" or "cancelled". - assert job.status() in {'pending', 'done', 'cancelled'} + # Job status can be "pending" or "done". + assert job.status() in {'pending', 'done'} # Let's wait until the jobs are finished. while job.status() != 'done': From 6f31f462765e944844b006809bb4d76a26a046b5 Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Tue, 25 Feb 2025 11:26:27 +0530 Subject: [PATCH 2/2] Improved docstring --- arango/job.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arango/job.py b/arango/job.py index 6e664763..85c96bc8 100644 --- a/arango/job.py +++ b/arango/job.py @@ -62,7 +62,8 @@ def status(self) -> str: :return: Async job status. Possible values are "pending" (job is still in queue), "done" (job finished or raised an error). :rtype: str - :raise arango.exceptions.AsyncJobStatusError: If retrieval fails. + :raise arango.exceptions.AsyncJobStatusError: If retrieval fails or + job is not found. """ request = Request(method="get", endpoint=f"/_api/job/{self._id}") resp = self._conn.send_request(request)