flytekit.extend.ExecutionState#

class flytekit.extend.ExecutionState(working_dir, mode=None, engine_dir=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

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, 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.

is_local_execution()

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

branch_eval_mode

user_space_params