Hey community! I’m getting an unexpected registrat...
# ask-the-community
a
Hey community! I’m getting an unexpected registration error after updating to the latest flytekit/flytectl that I’d appreciate help understanding!
Copy code
Error 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 🧵
Essentially what I have that is resulting in this error is:
Copy code
@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)
The way I’m reading the error is it seems like it thinks my reference launch plan
get_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]]
s
this could be the issue: https://github.com/flyteorg/flytekit/pull/2390/files#diff-68624e201f644896b015de1a5716eabef9b8b5a106caba1d9f21c51c0708684bR1663-R1664. but i'm not sure why the tag is being set to
Typed Dict
. cc @Kevin Su
could you re-register your launch plan with the latest flytekit and update the version in your code?
a
Ah I should have included this in my post: I am registering with flytectl 0.8.24 and flytekit 1.12.2. It looks like the change you linked is in that version if I’m reading this right
s
that's right. are you still seeing the error? have you tried reregistering your launch plan and updating the version?
a
Yes, after updating the version I still get the error on registration! (sorry for the delay, I was traveling!)
Oh actually.. would it make a difference if the
reference_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 version
k
we set the tag here. tag is the name of transformer. @Samhita Alla we might need to revert this line of change (Python Dictionary -> Typed Dict).
@Ailin Yu to unblock you first, you can re-register reference launch plan with new flytekit and run your workflow again
s
@Kevin Su should we revert? "typed dict" didn't feel right as dict needn't be typed anymore.
k
yes, I know, but it force them to re-register reference launch plan again, which is not good and error message is not clear.
typing.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
s
k
thank you 🙏