FlowSpec
Main class from which all Flows should inherit.Usage
Constructor
Set to True if the flow is invoked from main or the command line
Properties
Returns the name of the script containing the flow.Note: Legacy function - do not use. Use
current instead.The index of this foreach branch.In a foreach step, multiple instances of this step (tasks) will be executed,
one for each element in the foreach. This property returns the zero based index
of the current task. If this is not a foreach step, this returns None.If you need to know the indices of the parent tasks in a nested foreach, use
FlowSpec.foreach_stack.The value of the foreach artifact in this foreach branch.In a foreach step, multiple instances of this step (tasks) will be executed,
one for each element in the foreach. This property returns the element passed
to the current task. If this is not a foreach step, this returns None.If you need to know the values of the parent tasks in a nested foreach, use
FlowSpec.foreach_stack.Methods
foreach_stack
foo will take the following values in the various tasks for nest_2:
- The index of the task for that level of the loop.
- The number of splits for that level of the loop.
- The value for that level of the loop.
- 1st element: value returned by
self.index. - 3rd element: value returned by
self.input.
List[Tuple[int, int, Any]]- An array describing the current stack of foreach steps.
merge_artifacts
y(value: 6),b_var(value: 1)- if
from_bandfrom_care the same,xwill be accessible and have valuefrom_b - if
from_bandfrom_care different, an error will be thrown. To prevent this error, you need to manually setself.xin D to a merged value (for example the max) prior to callingmerge_artifacts.
Incoming steps to the join point.
If specified, do not consider merging artifacts with a name in
exclude.
Cannot specify if include is also specified.If specified, only merge artifacts specified. Cannot specify if
exclude is
also specified.MetaflowException- If not called in a join step.UnhandledInMergeArtifactsException- In case of unresolved conflicts.MissingInMergeArtifactsException- If an artifact specified inincludecannot be found.
next
next_step is a method in the current class decorated with the @step decorator.
Static fan-out connection:
stepX are methods in the current class decorated with the @step decorator.
Foreach branch:
foreach_step is a method in the current class decorated with the
@step decorator and foreach_iterator is a variable name in the current class that
evaluates to an iterator. A task will be launched for each value in the iterator and
each task will execute the code specified by the step foreach_step.
Switch statement:
step_a and step_b are methods in the current class decorated
with the @step decorator and condition_variable is a variable name in the current
class. The value of the condition variable determines which step to execute. If the
value doesn’t match any of the dictionary keys, a RuntimeError is raised.
One or more methods annotated with
@step.InvalidNextException- Raised if the format of the arguments does not match one of the valid formats.
