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
working_dir (Union[os.PathLike, str]) –
mode (Optional[flytekit.core.context_manager.ExecutionState.Mode]) –
engine_dir (Optional[Union[os.PathLike, str]]) –
branch_eval_mode (Optional[flytekit.core.context_manager.BranchEvalMode]) –
user_space_params (Optional[flytekit.core.context_manager.ExecutionParameters]) –
- mode#
Defines the context in which the task is executed (local, hosted, etc).
- Type
- working_dir#
Specifies the remote, external directory where inputs, outputs and other protobufs are uploaded
- Type
- engine_dir#
- Type
- 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
working_dir (Union[os.PathLike, str]) –
mode (Optional[flytekit.core.context_manager.ExecutionState.Mode]) –
engine_dir (Optional[Union[os.PathLike, str]]) –
branch_eval_mode (Optional[flytekit.core.context_manager.BranchEvalMode]) –
user_space_params (Optional[flytekit.core.context_manager.ExecutionParameters]) –
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
branch_eval_mode
user_space_params