:wave: hi folks….are there any workarounds for a f...
# ask-metaflow
s
👋 hi folks….are there any workarounds for a foreach that occasionally is an empty list?
1
v
you need at least one element in a foreach. You can do e.g.
Copy code
self.mylist = actual_list if actual_list else [None]
and then wrap the task in
if self.input is not None:
to make it a no-op if there's no actual data. You can make the no-op look a bit nicer with a `@skip` decorator like this
s
Awesome, thank you!
🙌 1