Hello.. running into some sort of variable binding...
# announcements
n
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"
    }
  }
}
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})
The intermediate type of
result1
is
Pomise(node:n0.o0)
which is expected but i think is causing an error?
e
@Nada Saiyed, 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
a_custom_plugin_task
or maybe building the dictionary as part of
a_custom_plugin_task
159 Views