Quick question about surprising behaviour of map t...
# ask-the-community
f
Quick question about surprising behaviour of map tasks: Code snippet in the 🧵 Does anyone know why for an input list of length 5,
list_q: list[int] = [1, 2, 3, 4, 5]
, there are 10 executions according to the UI? There also have been only 5 pods.
Copy code
import functools
from flytekit import map_task, task, workflow


@task
def multi_input_task(quantity: int, price: float, shipping: float) -> float:
    return quantity * price * shipping


@workflow
def multiple_workflow(list_q: list[int] = [1, 2, 3, 4, 5], p: float = 6.0, s: float = 7.0) -> list[float]:
    partial_task = functools.partial(multi_input_task, price=p, shipping=s)
    return map_task(partial_task)(quantity=list_q)
Example taken from the docs.
d
Think there's already an issue for this (maybe check). I think it is a UI bug where multiple log links are reported for each task, so each link is shown individually.
f
I searched through all issues found for the query “map task” but didn’t find anything among those. (Hope I didnt overlook it) I’ll create a new issue then. I can confirm that the number of shown executions is the multiplication of the actual number of pods times the number of configured log links per pod.
Thanks @Dan Rammer (hamersaw)