prefect.states
Functions
to_state_create
StateCreate
type which can be used to set the state of
a run in the API.
This method will drop this state’s data
if it is not a result type. Only
results should be sent to the API. Other data is only available locally.
get_state_result
State.result()
format_exception
exception_to_crashed_state
exception_to_failed_state
Failed
states from exceptions
return_value_to_state
State
the run should
be placed in.
- If data is returned, we create a ‘COMPLETED’ state with the data
- If a single, manually created state is returned, we use that state as given (manual creation is determined by the lack of ids)
- If an upstream state or iterable of upstream states is returned, we apply the aggregate rule
- If any states are not COMPLETED the final state is FAILED
- If all of the states are COMPLETED the final state is COMPLETED
- The states will be placed in the final state
data
attribute
get_state_exception
TypeError
will be returned.
When a wrapper exception is returned, the type will be:
FailedRun
if the state type is FAILED.CrashedRun
if the state type is CRASHED.CancelledRun
if the state type is CANCELLED.
raise_state_exception
is_state_iterable
- set
- list
- tuple
False
even if they contain states.
Scheduled
Scheduled
states.
Returns:
- a Scheduled state
Completed
Completed
states.
Returns:
- a Completed state
Running
Running
states.
Returns:
- a Running state
Failed
Failed
states.
Returns:
- a Failed state
Crashed
Crashed
states.
Returns:
- a Crashed state
Cancelling
Cancelling
states.
Returns:
- a Cancelling state
Cancelled
Cancelled
states.
Returns:
- a Cancelled state
Pending
Pending
states.
Returns:
- a Pending state
Paused
Paused
states.
Returns:
- a Paused state
Suspended
Suspended
states.
Returns:
- a Suspended state
AwaitingRetry
AwaitingRetry
states.
Returns:
- an AwaitingRetry state
AwaitingConcurrencySlot
AwaitingConcurrencySlot
states.
Returns:
- an AwaitingConcurrencySlot state
Retrying
Retrying
states.
Returns:
- a Retrying state
Late
Late
states.
Returns:
- a Late state