https://prefect.io logo
Title
k

Kyle McEntush

08/22/2020, 1:41 AM
Next newbie question: What's the best way to apply a task over a list? The task also takes additional static arguments that don't change for each element. I tried to use map but then it tried to access indices of the static args
c

Chris White

08/22/2020, 1:43 AM
Great question - Prefect has an
unmapped
wrapper for specifying static non-mapped arguments to a mapped function. Check out the example in the docstring here: https://docs.prefect.io/api/latest/utilities/edges.html#unmapped
:upvote: 1
n

nicholas

08/22/2020, 1:43 AM
Hi @Kyle McEntush - you can wrap your static inputs with
unmapped
to prevent mapped tasks from trying to iterate over them
:upvote: 1
k

Kyle McEntush

08/22/2020, 1:43 AM
You guys are such pros 😛
😂 1
:marvin: 1
This is the first time i'm revisiting prefect since v0.5 haha
n

nicholas

08/22/2020, 1:44 AM
Welcome back!