I have a mapped task, it returns a list of lists. I then flatten it and iterate over the results in another mapped task, as recommended in the docs. However, if the first task returns TRIGGERFAIL instead of a list of lists, when I run flatten, I get an error:
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/prefect/engine/runner.py”, line 48, in inner
new_state = method(self, state, *args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/prefect/engine/flow_runner.py”, line 520, in get_flow_run_state
mapped_children=children, executor=executor
File “/usr/local/lib/python3.6/site-packages/prefect/utilities/executors.py”, line 588, in flatten_mapped_children
[executor.submit(lambda c: len(c._result.value), c) for c in mapped_children]
File “/usr/local/lib/python3.6/site-packages/prefect/utilities/executors.py”, line 588, in <listcomp>
[executor.submit(lambda c: len(c._result.value), c) for c in mapped_children]
File “/usr/local/lib/python3.6/site-packages/prefect/executors/local.py”, line 28, in submit
return fn(*args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/prefect/utilities/executors.py”, line 588, in <lambda>
[executor.submit(lambda c: len(c._result.value), c) for c in mapped_children]
TypeError: object of type ‘TRIGGERFAIL’ has no len()