Differential D8684 Diff 40813 examples/docs_snippets/docs_snippets/concepts/io_management/output_config.py
Changeset View
Changeset View
Standalone View
Standalone View
examples/docs_snippets/docs_snippets/concepts/io_management/output_config.py
from dagster import IOManager, ModeDefinition, execute_pipeline, io_manager, pipeline, solid | from dagster import ( | ||||
IOManager, | |||||
ModeDefinition, | |||||
execute_pipeline, | |||||
io_manager, | |||||
pipeline, | |||||
solid, | |||||
) | |||||
def connect(): | def connect(): | ||||
pass | pass | ||||
def write_dataframe_to_table(**_kwargs): | def write_dataframe_to_table(**_kwargs): | ||||
pass | pass | ||||
Show All 29 Lines | def my_io_manager(_): | ||||
return MyIOManager() | return MyIOManager() | ||||
# io_manager_end_marker | # io_manager_end_marker | ||||
def execute_with_config(): | def execute_with_config(): | ||||
# execute_start_marker | # execute_start_marker | ||||
@pipeline(mode_defs=[ModeDefinition(resource_defs={"io_manager": my_io_manager})]) | @pipeline( | ||||
mode_defs=[ | |||||
ModeDefinition(resource_defs={"io_manager": my_io_manager}) | |||||
] | |||||
) | |||||
def my_pipeline(): | def my_pipeline(): | ||||
solid2(solid1()) | solid2(solid1()) | ||||
execute_pipeline( | execute_pipeline( | ||||
my_pipeline, | my_pipeline, | ||||
run_config={ | run_config={ | ||||
"solids": { | "solids": { | ||||
"solid1": {"outputs": {"result": {"table": "table1"}}}, | "solid1": {"outputs": {"result": {"table": "table1"}}}, | ||||
"solid2": {"outputs": {"result": {"table": "table2"}}}, | "solid2": {"outputs": {"result": {"table": "table2"}}}, | ||||
} | } | ||||
}, | }, | ||||
) | ) | ||||
# execute_end_marker | # execute_end_marker |