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] Muilt-input map task accept list input if it is the default argument #5727

Open
2 tasks done
dansola opened this issue Sep 6, 2024 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers

Comments

@dansola
Copy link
Contributor

dansola commented Sep 6, 2024

Describe the bug

Currently Flyte does not support partial task with lists as inputs.

e.g.

@task
def mult_sum(my_val: int, my_list: list[int]) -> int:
    return sum(my_val * v for v in my_list)


@workflow
def wf() -> list[int]:
    my_list = [1, 2, 3]
    my_vals = [1, 2]
    partial_task = functools.partial(mult_sum, my_list=my_list)
    return map_task(partial_task)(my_val=my_vals)
ValueError: Cannot use a partial task with lists as inputs

However if my_list is a default workflow argument like so:

@workflow
def wf(my_list: list[int] = [1, 2, 3]) -> list[int]:
    my_vals = [1, 2]
    partial_task = functools.partial(mult_sum, my_list=my_list)
    return map_task(partial_task)(my_val=my_vals)

No error is shown - in fact it works correctly when you run locally.

When you run remotely you get a somewhat ambiguous error without a traceback"

input arrays have different lengths: expecting '3' found '2'

Expected behavior

Ideally it would be nice to support partial task with lists as inputs, but if not, it would be great to have a similar compile time/local runtime error ValueError saying that Cannot use a partial task with lists as inputs.

Additional context to reproduce

No response

Screenshots

No response

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

  • Yes

Have you read the Code of Conduct?

  • Yes
@dansola dansola added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Sep 6, 2024
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

1 participant