dagster-io / dagster

An orchestration platform for the development, production, and observation of data assets.
https://dagster.io
Apache License 2.0
11.12k stars 1.39k forks source link

[Documentation Feedback] Request to add explanation of the ordering of multiple outputs from an op #6939

Open markfickett opened 2 years ago

markfickett commented 2 years ago

When an op returns multiple values, as it does in the case of the conditional branching example, it's not documented what order they will be in.

It would be great to incorporate this answer on Slack into the docs: https://dagster.slack.com/archives/C01U954MEER/p1646422324967139?thread_ts=1646357933.951519&cid=C01U954MEER

The object representing the multiple outputs is a namedtuple. You can destructure as you are based on the order of elements in the tuple. The order is determined by the order of the dictionary passed to out. The name of the variables you assign to has no effect. You can capture the tuple directly and then key using the names of the outputs though.

outs = branching_op()
branch_1 = outs.branch_1
yuhan commented 2 years ago

Thanks for filing the issue. Will incorporate into the docs.