What is a Job?
jobs
method on the workflow client.
max_retries
argument of the submit
method.
MyFlakyTask
fails, it will be retried up to five times before being marked as failed.
cluster
argument of the submit
method.
query
method on the job client.
find
method on the job client to get a job by its ID.
find
is also a useful tool for fetching a jobs state after a while, to check if it’s still running or has already completed.QUEUED
: the job is queued and waiting for executionSTARTED
: at least one task of the job has been startedCOMPLETED
: all tasks of the job have been completeddisplay
is designed for use in an interactive environment such as a Jupyter notebook. In non-interactive environments, use visualize, which returns the rendered diagram as an SVG string.Task State | Color | Description |
---|---|---|
Queued | SalmonYellow | The task is queued and waiting for execution. |
Running | Blue | The task is currently being executed. |
Computed | Green | The task has successfully been computed. If a task is computed, and all it’s sub-tasks are also computed, the task is considered completed. |
Failed | Red | The task has been executed but encountered an error. |
MyTask
, has executed and spawned three sub-tasks.SubTask
that is still executing has not generated any sub-tasks yet, as sub-tasks are queued for execution only after the parent task finishes and becomes computed.DependentTask
requires the LeafTask
to complete before it can be executed.display
field of the current_task
object in the task’s execution context. The maximum length for a display name is 1024 characters, with any overflow truncated. Line breaks using \n
are supported as well.
cancel
method on the job client to cancel a job.
PrintMovieStats
task.
PrintMovieStats
tasks fails with a KeyError
. This error occurs when a movie title is not found by the OMDb API, leading to a response without the Title
and Released
fields.
Console output from the task runners confirms this:
PrintMovieStats
is as follows:
PrintMovieStats
implementation, you can retry the job: