Hi <@ULVA73B9P> where can I find `task.map` defini...
# marvin-in-the-wild
z
Hi @Marvin where can I find
task.map
definition in prefect code?
m
The
task.map
definition and usage in Prefect can be found in the Prefect documentation under the section about tasks. The documentation describes
.map()
as an implementation that automatically creates a task run for each element of its input data. Mapped tasks represent the computations of many individual children tasks. Here is a direct link to the relevant section of the documentation: Tasks - Map And a brief example of its usage:
Copy code
python
from prefect import flow, task

@task
def square_num(num):
    return num**2

@flow
def map_flow(nums):
    squared_nums = square_num.map(nums)
    #... rest of your flow
You can see more examples and explanations in the provided link.