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:
- 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.
Methods
- branch_complete()[source]¶
Indicates that we are within a conditional / ifelse block and the active branch is not done. Default to SKIPPED
- take_branch()[source]¶
Indicates that we are within an if-else block and the current branch has evaluated to true. Useful only in local execution mode
- with_params(working_dir=None, mode=None, engine_dir=None, branch_eval_mode=None, user_space_params=None)[source]¶
Produces a copy of the current execution state and overrides the copy’s parameters with passed parameter values.
- Parameters:
working_dir (Optional[os.PathLike])
mode (Optional[Mode])
engine_dir (Optional[os.PathLike])
branch_eval_mode (Optional[BranchEvalMode])
user_space_params (Optional[ExecutionParameters])
- Return type:
Attributes
- branch_eval_mode: BranchEvalMode | None
- user_space_params: ExecutionParameters | None