Page MenuHomeElementl

[op] Get rid of MultiOut, get rid of name on Out, change to accepting bare dict, clean up tuple typing implementation.
ClosedPublic

Authored by cdecarolis on Jun 30 2021, 6:18 PM.

Diff Detail

Repository
R1 dagster
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

assuming this is on trajectory for realness instead of just quick prototype - I think we need a battery of test on the multi out stuff

  • tuple size mismatched with out dict (in both directions)
  • wrong type hint (not tuple) on multi out
  • more crazy stuff you can think of
python_modules/dagster/dagster/core/definitions/decorators/op.py
131

maybe worth taking a first pass on this doc block to start iterating on how we are going to communicate the behavior we are building here

python_modules/dagster/dagster_tests/core_tests/definitions_tests/decorators_tests/test_op.py
161–163

add a test for

@op(out={"a": Out(), "b": Out()})
def my_op() -> Tuple[int, str]:
    return 1, "q"

I assume thats the minimal way to change it from single output of type tuple to mult-out if inner tuple params

This revision now requires changes to proceed.Jun 30 2021, 8:14 PM

Add test battery for multiout stuff

Use get_origin to resolve type

im cool with this - last pass from @sandyryza for api sign off

python_modules/dagster/dagster/core/definitions/decorators/op.py
131

bump: documenting here or in follow up

python_modules/dagster/dagster/core/definitions/output.py
293–306

nit: typing.NamedTuple

This revision is now accepted and ready to land.Tue, Jul 6, 8:26 PM

typing.NamedTuple / Ensure I didn't break anything