bumpy-match-83743
07/27/2024, 2:52 PMancient-wolf-19325
07/27/2024, 2:52 PMbumpy-match-83743
07/27/2024, 2:54 PMancient-wolf-19325
07/27/2024, 2:54 PMfrom flytekit import map_task, task, workflow
@task
def square(x: int) -> int:
return x * x
@workflow
def my_workflow(numbers: list[int]) -> list[int]:
return map_task(square)(x=numbers)
In this example:
1. The square
task takes an integer and returns its square.
2. The my_workflow
workflow uses map_task
to apply the square
task to each element in the numbers
list.
For more details on map tasks in Flyte, you can refer to the Flyte documentation on map tasks.
If you need more specific guidance on using Java with Flyte, please let me know!
Sources:
- Flyte documentation on map tasks 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.