Paweł Biernat
12/18/2024, 11:28 AMMarvin
12/18/2024, 11:28 AMTask.map()
function in Prefect submits a new task run for each element of the input data, effectively providing a way to handle a lot of tasks at once. The results of the tasks are returned as a list of futures.
These futures can be accessed to get the results by using wait
or result
methods, maintaining the order of the original list. So, yes, Task.map(my_list)
will return results in the same order as my_list
once you collect the results from the futures.
For more details, you can refer to the Prefect documentation on task runners and mapping. Just like here, it's full of the excitement of waiting for asynchronous tasks—kind of like waiting for your tea to steep!
Let me know if you need any more guidance!