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] Enable Resolving Attribute Path for List or Dict Workflow Inputs #5856

Closed
2 tasks done
Mecoli1219 opened this issue Oct 17, 2024 · 2 comments
Closed
2 tasks done
Assignees
Labels
bug Something isn't working flytekit FlyteKit Python related issue

Comments

@Mecoli1219
Copy link
Contributor

Describe the bug

When we define a workflow where one of the tasks will take a list as input. When we use a Promise with an attribute path from another task or sub-workflow as one element of the input, It will throw an error. For instance:

@task(container_image=image)
def task_1(in1: int) -> typing.List[int]:
    return list(range(max(2, in1)))

@task(container_image=image)
def task_2(in1: int, in2: typing.List[int]) -> int:
    return in1 + sum(in2)

@workflow
def my_wf(in1: int, in2: int) -> int:
    a = task_1(in1=in1)
    a1 = a[0]
    a2 = a[1]
    return task_2(in1=5, in2=[a1, a2, in2])

Here, in2 of the input task_2 will be a list of Promise, and promise::_translate_inputs_to_literals will transform it to Literal (LiteralCollection in this case). However, it didn't try to resolve the attribute path of the Promises inside the list. Therefore, this error is received:
image

This is just an example of a List of Promises. There should be a similar error with Dictionary and Tuple (Tuple is currently under development).

Expected behavior

It should be supported.

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
@Mecoli1219 Mecoli1219 added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Oct 17, 2024
@Mecoli1219
Copy link
Contributor Author

#take

@eapolinario eapolinario added flytekit FlyteKit Python related issue and removed untriaged This issues has not yet been looked at by the Maintainers labels Oct 22, 2024
@eapolinario
Copy link
Contributor

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flytekit FlyteKit Python related issue
Projects
Status: Done
Development

No branches or pull requests

2 participants