Give me an example of an op that returns 2 differe...
# ask-ai
m
Give me an example of an op that returns 2 different outputs at the same time with different types
s
Certainly! Here's an example from the documentation where an op is defined with multiple outputs of different types:
Copy code
python from dagster import op, Out from typing import Tuple  @op(out={"int_output": Out(), "str_output": Out()}) def my_multiple_output_op() -> Tuple[int, str]:     return (5, "foo")
In this example, the
my_multiple_output_op
op is defined with two outputs:
int_output
and
str_output
. The op returns a tuple with two elements, where the first element is an integer and the second is a string. The outputs are expected to follow the order they are specified in the op's
out
dictionary, so the
int
output corresponds to
int_output
, and the
str
output corresponds to
str_output
.