Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override the container image of map task #2011

Merged
merged 3 commits into from
Dec 1, 2023
Merged

Conversation

pingsutw
Copy link
Member

Tracking issue

flyteorg/flyte#4493

Describe your changes

This PR allows users to override the python_function_task inside of map task.

with_override doesn't work with map task since we didn't override the python_function_task inside of map task.

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Setup Process

import typing

from flytekit import task, workflow, map_task
# from flytekit.experimental import map_task

@task
def my_mappable_task(a: int) -> typing.Optional[str]:
    return str(a)


@workflow
def wf(x: typing.List[int]=[1, 2, 3, 5]) -> typing.List[typing.Optional[str]]:
    map_task(my_mappable_task, concurrency=10, min_success_ratio=0.75)(a=x)
    a = map_task(my_mappable_task, concurrency=10, min_success_ratio=0.75)(a=x).with_overrides(container_image="random:image")
    return a


if __name__ == '__main__':
    wf(x=[1, 2, 3])

Copy link

codecov bot commented Nov 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e5c3c78) 85.22% compared to head (7a30eb5) 86.16%.
Report is 23 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2011      +/-   ##
==========================================
+ Coverage   85.22%   86.16%   +0.94%     
==========================================
  Files         287      320      +33     
  Lines       22072    23448    +1376     
  Branches     3528     3460      -68     
==========================================
+ Hits        18810    20204    +1394     
+ Misses       2659     2652       -7     
+ Partials      603      592      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Kevin Su <[email protected]>
@eapolinario eapolinario merged commit 5cc1b71 into master Dec 1, 2023
75 checks passed
RRap0so pushed a commit to RRap0so/flytekit that referenced this pull request Dec 15, 2023
* Override the container image of map task

Signed-off-by: Kevin Su <[email protected]>

* nit

Signed-off-by: Kevin Su <[email protected]>

* fix tests

Signed-off-by: Kevin Su <[email protected]>

---------

Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Rafael Raposo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants