Skip to content

Commit

Permalink
Map task updates (flyteorg#742)
Browse files Browse the repository at this point in the history
* Updating map task

Signed-off-by: Alekhya Sai Punnamaraju <[email protected]>

* Updating map task

Signed-off-by: Alekhya Sai Punnamaraju <[email protected]>

* Removed map task plugins and added it to flytekit.map_task

Signed-off-by: Alekhya Sai Punnamaraju <[email protected]>

* Updated the AWS batch link

Signed-off-by: Alekhya Sai Punnamaraju <[email protected]>

* Adding default as K8s

Signed-off-by: Alekhya Sai Punnamaraju <[email protected]>

* Update cookbook/core/control_flow/map_task.py

Co-authored-by: Samhita Alla <[email protected]>

Co-authored-by: Samhita Alla <[email protected]>
  • Loading branch information
AlekhyaSasi and samhita-alla authored May 5, 2022
1 parent a2363f7 commit 53fc67f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cookbook/core/control_flow/map_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
"""

# %%
# First, we import the libraries.
# First, import the libraries.
import typing

from flytekit import Resources, map_task, task, workflow


# %%
# Next, we define a task that we will use in our map task.
# Next, define a task to use in the map task.
#
# .. note::
# A map task can only accept one input and produce one output.
Expand All @@ -34,7 +34,7 @@ def a_mappable_task(a: int) -> str:


# %%
# We also define a task to reduce the mapped output to a string.
# Also define a task to reduce the mapped output to a string.
@task
def coalesce(b: typing.List[str]) -> str:
coalesced = "".join(b)
Expand All @@ -43,7 +43,7 @@ def coalesce(b: typing.List[str]) -> str:

# %%
# We send ``a_mappable_task`` to be repeated across a collection of inputs to the :py:func:`~flytekit:flytekit.map_task` function.
# In our example, ``a`` of type ``typing.List[int]`` is the input.
# In the example, ``a`` of type ``typing.List[int]`` is the input.
# The task ``a_mappable_task`` is run for each element in the list.
#
# ``with_overrides`` is useful to set resources for individual map task.
Expand All @@ -65,5 +65,5 @@ def my_map_workflow(a: typing.List[int]) -> str:
print(f"{result}")

# %%
# Map tasks can run on alternate execution backends, such as `AWS Batch <https://aws.amazon.com/batch/>`__,
# which is a provisioned service that can scale to great sizes.
# By default, the map task uses the K8s Array plugin. Map tasks can also run on alternate execution backends, such as `AWS Batch <https://docs.flyte.org/en/latest/deployment/plugin_setup/aws/batch.html#deployment-plugin-setup-aws-array>`__,
# a provisioned service that can scale to great sizes.

0 comments on commit 53fc67f

Please sign in to comment.