hey folks, can you remind me if it is possible to ...
# ask-metaflow
g
hey folks, can you remind me if it is possible to have conditions if(some) self.next(STEP_A), else self.next(STEP_B)
1
v
g
thanks!
🙌 1
b
Thanks @straight-shampoo-11124 for the workarounds, but maybe since argo workflows has conditionals, it might be worth considering as an argo-specific feature?https://argoproj.github.io/argo-workflows/walk-through/conditionals/
With workaround in option 1, if one branch is a no-op because it falls in the "else" clasuse, is there a way we can display this with the UI? (e.g. gray out the step)?
v
yep, definitely not impossible. There are a few upcoming features that will address some of the use cases of conditionals: • Event triggering will allow you to create events programmatically based on any conditions, so you can trigger "subflows" conditionally • We are actively looking into composing flows from separate subflows, so you can compose larger flows based on various conditions known before the run starts
good question about the UI. I don't think there's a straightforward way of doing it today. Skipped tasks will have a very short duration in the timeline view, which gives some indirect indication that it was skipped
you can easily have a custom element in a
@card
indicating that the task/step was skipped
b
Great. I'll look into it.
👍 1
r
hello! I was wondering how would it be possible to skip a step
foreach
based on the list given as input, if it's empty -> we skip. Even by adding a skip annotation custom, i still get
IndexError: tuple index out of range
in /metaflow/runtime.py", line 474.
v
unfortunately Metaflow doesn’t allow skipping steps altogether today. The best approximation is to have one no-op task
r
So the goal would be to inject one element inside the listing for the
foreach
step that would make it work but inside of it we do nothing right?
s
old thread, but it's available now