Choenden Kyirong
04/14/2023, 5:18 AM@task
def task(x: str, y: int):
...
@flow
def flow():
list_1, list_2 = ['a', 'b'], [1, 2]
for input_1, input_2 in zip(list_1, list_2):
task(input_1, input_2)
Would this be done via:
task.map(list_1 , list_2)
Or will prefect only iterate only one of the parameters?Tim Galvin
04/14/2023, 5:30 AM.map
operation will behaviour exactly as you are hoping here, so long as those lists are of equal length,
The prefect
unmapped
function (I think it is in the main namespace) can be used to tell prefect not to iterate / zip over something if need be,
task.map(list_1, unmapped(list_2))
if you want list_2
to be passed in complete form to each call into task
Choenden Kyirong
04/14/2023, 5:32 AM