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] Optional type transform not working in dynamic workflow #3748

Closed
2 tasks done
jganbat-fn opened this issue Jun 5, 2023 · 0 comments · Fixed by flyteorg/flytepropeller#571
Closed
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@jganbat-fn
Copy link

jganbat-fn commented Jun 5, 2023

Describe the bug

Optional type transformation on output is not working during dynamic workflow compilation.

Following example workflow:

from __future__ import absolute_import, division, print_function
from typing import Optional

from flytekit import task, workflow, dynamic
from flytekit.types.file import FlyteFile

@task
def hello(myfile: Optional[FlyteFile]) -> Optional[FlyteFile]:
    return None

@dynamic
def dyn_hello(myfile: Optional[FlyteFile]) -> Optional[FlyteFile]:
    return hello(myfile=myfile)


@workflow
def child_workflow(myfile: Optional[FlyteFile]) -> Optional[FlyteFile]:
    hello_output = dyn_hello(myfile=myfile)
    return hello_output

when executed showing the following issue in FlytePropeller

E0601 21:21:14.327422       1 workers.go:102] error syncing 'flyte-sandbox/anwfrlcbl62scwxzsnh7': 0: [User] malformed dynamic workflow, caused by: Collected Errors: 2
	Error 0: Code: MismatchingTypes, Node Id: end-node, Description: Variable [o1] (type [union_type:<variants:<blob:<> structure:<tag:"FlyteFilePath" > > variants:<simple:NONE structure:<tag:"none" > > > ]) doesn't match expected type [union_type:<variants:<blob:<> > variants:<simple:NONE > > ].
	Error 1: Code: ParameterNotBound, Node Id: end-node, Description: Parameter not bound [o1].

Flytekit version: v1.4
Flytepropeller version: v1.1.91

Expected behavior

Optional output type is correctly transformed and routed to downstream tasks or returned.

relevant slack conversation is here https://flyte-org.slack.com/archives/CP2HDHKE1/p1685654534312309

Additional context to reproduce

Register and run the example workflow described above in sandbox.

Screenshots

No response

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

  • Yes

Have you read the Code of Conduct?

  • Yes
@jganbat-fn jganbat-fn added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Jun 5, 2023
@eapolinario eapolinario removed the untriaged This issues has not yet been looked at by the Maintainers label Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants