flytekit.extend.ExecutionState

class flytekit.extend.ExecutionState(working_dir, mode=None, engine_dir=None, additional_context=None, branch_eval_mode=None, user_space_params=None)[source]

This is the context that is active when executing a task or a local workflow. This carries the necessary state to execute. Some required things during execution deal with temporary directories, ExecutionParameters that are passed to the user etc.

Parameters
mode

Defines the context in which the task is executed (local, hosted, etc).

Type

ExecutionState.Mode

working_dir

Specifies the remote, external directory where inputs, outputs and other protobufs are uploaded

Type

os.PathLike

engine_dir
Type

os.PathLike

additional_context Optional[Dict[Any, Any]]

Free form dictionary used to store additional values, for example those used for dynamic, fast registration.

branch_eval_mode Optional[BranchEvalMode]

Used to determine whether a branch node should execute.

user_space_params Optional[ExecutionParameters]

Provides run-time, user-centric context such as a statsd handler, a logging handler, the current execution id and a working directory.

__init__(working_dir, mode=None, engine_dir=None, additional_context=None, branch_eval_mode=None, user_space_params=None)[source]
Parameters

Methods

__init__(working_dir[, mode, engine_dir, ...])

branch_complete()

Indicates that we are within a conditional / ifelse block and the active branch is not done.

take_branch()

Indicates that we are within an if-else block and the current branch has evaluated to true.

with_params([working_dir, mode, engine_dir, ...])

Produces a copy of the current execution state and overrides the copy's parameters with passed parameter values.

Attributes

mode

working_dir

engine_dir

additional_context

branch_eval_mode

user_space_params