Piotr Danielczyk
04/27/2023, 11:41 AM@op(out={"first_output": Out(is_required=False), "second_output": Out(is_required=False)})
def my_op(context) -> Tuple[Output[str], Output[str]]:
yield Output("first_output", "first_output"), Output("second_output", "second_output")
However, I'm getting such an error:
dagster._core.errors.DagsterInvariantViolationError: Compute function for op "my_op" yielded a value of type <class 'tuple'> rather than an instance of Output, AssetMaterialization, or ExpectationResult. Values yielded by ops must be wrapped in one of these types. If your op has a single output and yields no other events, you may want to use `return` instead of `yield` in the body of your op compute function. If you are already using `return`, and you expected to return a value of type <class 'tuple'>, you may be inadvertently returning a generator rather than the value you expected.
I tried modifying that code in multiple ways, nothing helped. When returning one Output, it works.
Any idea how to return multiple Outputs?
Thanks in advance! 🙂chris
04/27/2023, 5:39 PMPiotr Danielczyk
04/28/2023, 6:35 AM