prefect.utilities.engine
collect_task_run_inputs
collect_task_run_inputs_sync
capture_sigterm
resolve_inputs
Quote
, PrefectFuture
, or State
types nested in parameters into
data.
Returns:
UpstreamTaskError
: If any of the upstream states are not COMPLETED
propose_state
state
will be augmented with
details and returned.
If the proposed state is rejected, a new state returned by the Prefect API will be
returned.
If the proposed state results in a WAIT instruction from the Prefect API, the
function will sleep and attempt to propose the state again.
If the proposed state results in an ABORT instruction from the Prefect API, an
error will be raised.
Args:
state
: a new state for a flow runflow_run_id
: an optional flow run id, used when proposing flow run statesprefect.exceptions.Abort
: if an ABORT instruction is received from
the Prefect APIpropose_state_sync
state
will be augmented with
details and returned.
If the proposed state is rejected, a new state returned by the Prefect API will be
returned.
If the proposed state results in a WAIT instruction from the Prefect API, the
function will sleep and attempt to propose the state again.
If the proposed state results in an ABORT instruction from the Prefect API, an
error will be raised.
Args:
state
: a new state for the flow runflow_run_id
: an optional flow run id, used when proposing flow run statesValueError
: if flow_run_id is not providedprefect.exceptions.Abort
: if an ABORT instruction is received from
the Prefect APIget_state_for_result
link_state_to_result
must have been called first.
link_state_to_flow_run_result
link_state_to_task_run_result
link_state_to_result
id
of the components to map to the state. The cache is persisted to the
current flow run context since task relationships are limited to within a flow run.
This allows dependency tracking to occur when results are passed around.
Note: Because id
is used, we cannot cache links between singleton objects.
We only cache the relationship between components 1-layer deep.
Example:
Given the result [1, [“a”,“b”], (“c”,)], the following elements will be
mapped to the state:
1
will not be mapped to the state because it is a singleton.
Other Notes:
We do not hash the result because:
__prefect_state__
, on the result because:
should_log_prints
check_api_reachable
emit_task_run_state_change_event
resolve_to_final_result
PrefectFuture
, or State
types nested in parameters into
data. Designed to be use with visit_collection
.
resolve_inputs_sync
Quote
, PrefectFuture
, or State
types nested in parameters into
data.
Returns:
UpstreamTaskError
: If any of the upstream states are not COMPLETED