Vlad Dumitrascu
08/23/2021, 5:10 PMoutput_defs=[
OutputDefinition(name="result_dict", dagster_type=dict,
description="A dictionary of results."),
OutputDefinition(name="entry_list", dagster_type=list,
description='''A list of dictionaries with the details of the update.''')
]
..and then you Yield outputs at the end of the function:
yield Output( result_dict, output_name="result_dict")
yield Output( entry_list, output_name="entry_list")
...you can, obviously, name them whatever you want and they can be all the same types that an input can be.
In the yield Output()
, the first position is the data within your function. The second string is the named output, which you defined at the top.
Also, you can output a bunch of stuff and don't have to use it. I often make general purpose solids that output the same data in various ways, and formats, and then only connect the outputs I need for that pipeline. Makes them more re-usable.
For completeness:
You also have to import the Output type:
from dagster import Output
Devaraj Nadiger
08/24/2021, 4:54 AMVlad Dumitrascu
08/24/2021, 11:24 PM