https://dagster.io/ logo
Title
v

Vlad Dumitrascu

08/23/2021, 5:10 PM
You can do just what you said. Your pipeline will look exactly like you wrote it. In the solid, though, you have to define two outputs like so: 1. Define the name and type of the outputs in the top:
output_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
❤️ 1
d

Devaraj Nadiger

08/24/2021, 4:54 AM
thanks @Vlad Dumitrascu, this is exactly what I wanted. sorry I did not go through this.
v

Vlad Dumitrascu

08/24/2021, 11:24 PM
pay it forward when someone else asks something 🙂