microscopic-honey-72761
06/19/2024, 11:17 PMError 0: Code: MismatchingTypes, Node Id: n4, Description: Variable [o0] (type [union_type:{variants:{simple:STRUCT structure:{tag:"Typed Dict"}} variants:{simple:NONE structure:{tag:"none"}}}]) doesn't match expected type [union_type:{variants:{simple:STRUCT structure:{tag:"Python Dictionary"}} variants:{simple:NONE structure:{tag:"none"}}}].
Error 1: Code: ParameterNotBound, Node Id: n4, Description: Parameter not bound [values].
More details in 🧵microscopic-honey-72761
06/19/2024, 11:18 PM@reference_launch_plan(...)
def get_values_workflow() -> typing.Optional[dict[int, float]]:
...
@task
def process_values_task(values: typing.Optional[dict[int, float]]) -> typing.Optional[FlyteFile]:
if values is None:
logger.warning("No values to process)
return None
else:
figure = create_output_flytefile(values)
return figure
@workflow
def main_workflow() -> CustomResultClass:
values = get_values_workflow()
flytefile = process_values_task(values=values)
return CustomResultClass(myfile=flytefile)
microscopic-honey-72761
06/19/2024, 11:20 PMget_values_workflow
is returning a Typed Dict
but it’s expecting the input to my task process_values_task
to be a Python Dictionary
, even though I’ve defined the return type and input types both to be typing.Optional[dict[int, float]]
tall-lock-23197
Typed Dict
. cc @glamorous-carpet-83516tall-lock-23197
microscopic-honey-72761
06/20/2024, 5:07 PMtall-lock-23197
microscopic-honey-72761
06/25/2024, 8:05 PMmicroscopic-honey-72761
06/25/2024, 8:08 PMreference_launch_plan
was registered in a different project with an older version? I realized with my main_workflow
in this example, I’m registering using the latest flytekit & flytectl, but the reference launch plan (get_values_workflow
in this example) may have been registered with an older versionglamorous-carpet-83516
06/25/2024, 8:32 PMtall-lock-23197
glamorous-carpet-83516
06/26/2024, 7:38 AMglamorous-carpet-83516
06/26/2024, 7:41 AMtyping.Dict[str, int]
will still be serialized to idl by DictTransformer, right? I think user doesn’t care about the name of the transformer though. we could add some comments in init
tall-lock-23197
glamorous-carpet-83516
06/26/2024, 8:49 AM