Hello.. running into some sort of variable binding bug. Can anyone help me fix this?
I have a task which takes in a
Dict
as input. One of the values in that
Dict
is returned from previous task and Flyte is not able to bind the value.
I get this AssertionError
Copy code
AssertionError: this should be a Dictionary type and it is not: <class 'dict'> vs union_type {
variants {
map_value_type {
simple: STRING
}
structure {
tag: "Typed Dict"
}
}
variants {
simple: NONE
structure {
tag: "none"
}
}
}
plain-carpenter-67621
08/25/2022, 8:14 PM
E.g.
Copy code
result1 = a_generic_python_task() #returns a str
# a_custom_plugin_task accepts a variable x of type
# typing.Dict[str,str]
result2 = a_custom_plugin_task(x={'key':result1})
plain-carpenter-67621
08/25/2022, 8:14 PM
The intermediate type of
result1
is
Pomise(node:n0.o0)
which is expected but i think is causing an error?
h
high-accountant-32689
08/25/2022, 9:19 PM
@plain-carpenter-67621, you can't build inputs on the fly using outputs of upstream tasks. Is there any way you can modify
a_generic_python_task
to return the dictionary you're passing to
a_custom_plugin_task
? Another option would be to add a step in the middle to build the dictionary prior to calling