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

[BUG] Map_task should support launch plans, but get type errors #6236

Open
2 tasks done
pimdh opened this issue Feb 10, 2025 · 0 comments
Open
2 tasks done

[BUG] Map_task should support launch plans, but get type errors #6236

pimdh opened this issue Feb 10, 2025 · 0 comments
Assignees
Labels
bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers

Comments

@pimdh
Copy link

pimdh commented Feb 10, 2025

Describe the bug

The API suggests that map_task supports a launchplan. However, if I try the following, I get typing errors:

from flytekit import LaunchPlan, map_task, task, workflow


@task
def my_task(x: int) -> int:
    return x * 2


@workflow
def my_wf(x: int) -> int:
    return my_task(x)


my_lp = LaunchPlan.create("my_lp", my_wf)


@workflow
def map_wf(nums: list[int]) -> list[int]:
    return map_task(my_lp)(x=nums)

Upon registration, I get the following errors:

        Details: failed to compile workflow for [resource_type:WORKFLOW project:"scratch" domain:"main" name:"flyte_playground.map_launchplan.map_wf" version:"767711eb9510a25f9b7512cd"] with err: Collected Errors: 2
        Error 0: Code: MismatchingTypes, Node Id: end-node, Description: The output variable 'my_lp.o0' has type [simple:INTEGER], but it's assigned to the input variable 'o0' which has type type [collection_type:{simple:INTEGER}].
        Error 1: Code: MismatchingTypes, Node Id: n0, Description: The output variable 'nums' has type [collection_type:{simple:INTEGER}], but it's assigned to the input variable 'my_lp.x' which has type type [simple:INTEGER].

May be related to #5684

Expected behavior

Should be registered fine.

Additional context to reproduce

Flytekit 1.14.6

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@pimdh pimdh added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Feb 10, 2025
@eapolinario eapolinario self-assigned this Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers
Projects
Status: Backlog
Development

No branches or pull requests

2 participants