Hello Flyte folks, so I am trying to use Optional ...
# ask-the-community
j
Hello Flyte folks, so I am trying to use Optional type in our workflow, however i have been seeing this error, i have reproduced in a sandbox as well. More ๐Ÿงต
Following workflow
Copy code
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
above workflow when executed showing the following issue in FlytePropeller
Copy code
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].
I think there is somethign wrong during dynamic WF compilation ๐Ÿค” I am on flytekit 1.4
@Yee or @Ketan (kumare3) do you all have any insight or pointer in the code where i can double check ๐Ÿ˜…
y
i think @Kevin Su is probably most familiar with this?
k
looking. something wrong in the compiler of propeller
j
ohh its on propeller, any update ๐Ÿ˜…
e
@Jay Ganbat, we're actively investigating this. Expect an update by EOD today.
v
Iโ€™m migrating a workflow from another project to using Flyte, and it uses Optional type, so I ran into the same issue as well. Is this something that used to work and then broke, or just not yet supported? If using an older flyte version would help it, please let me know which version to revert to. Thanks
j
I can open up a Issue in github for better tracking
k
thanks, please do it. [flyte-bug]
j
161 Views