<@U06RKAMK0UC> Does Flyte v1 support Typed diction...
# ask-ai
w
@ancient-wolf-19325 Does Flyte v1 support Typed dictionaries as ouputs
j
Reasoning Complete! 🤖 🔍 Searched knowledge base: I'll look up whether Flyte v1 supports using Typed dictionaries as outputs to provide you with an accurate answer. • Searching over 10 data sources from the following: File, Github File, Github Issue, Web • Found 65 documents that could be relevant from the following data sources: Github File, Github Issue, Github Pull Request, Web Content. • Filtered down to the top 30 most relevant documents. ✍️ Generated answer: I've found clear information that Flyte v1 (from flytekit version 1.14.0 onward) supports typed dictionaries as outputs, with some caveats for certain edge cases. I can now provide you with a complete answer.
Yes, Flyte v1 supports typed dictionaries (e.g.,
Dict<https://github.com/flyteorg/flytekit/blob/master/tests/flytekit/unit/cli/pyflyte/default_arguments/map_wf.py|str, int]
) as outputs for tasks and workflows. This is confirmed by both documentation and test cases, such as tasks returning
Dict[str, int]
and workflows using them as outputs, which work as expected in Flyte v1.14+ and are covered in Flyte's official examples and tests ([map_wf.py>, test_type_engine_binary_idl.py). However, note that untyped dictionaries (
dict
or
Dict
without key/value types) are handled differently and may be serialized as msgpack or protobuf struct, but typed dictionaries like
Dict<https://github.com/flyteorg/flyte/blob/master/docs/user_guide/data_types_and_io/pydantic_basemodel.md|str, int]
are natively supported and maintain their types across task boundaries ([pydantic_basemodel.md>). Would you like more detail or code examples? Sources: - test_type_engine_binary_idl.py - pydantic_basemodel.md - map_wf.py 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.