https://dagster.io/ logo
Title
i

Ivan Tsarev

03/09/2023, 6:34 PM
Hi everyone! Does someone have an example of how to make dagster_type checks work when I want to pass there Union with custom class and something else like python built-in. ScalarUnion seems like not supposed to cover this case since there is no scalar class and PythonObjectDagsterType does not support custom classes just python buillt-in types.
c

chris

03/09/2023, 11:39 PM
Can you send an example of the type you would want to work?
i

Ivan Tsarev

03/10/2023, 4:40 AM
To be honest, it`s just simple Enum, so my code looks like this:
class Foo(Enum):
  bar = "bar"
  buz = "buz"

@op
def my_cool_op(some_input: Dict[str, Union[str, Foo]):
  pass
So from here part with
Union[str, Foo]
just does not want work whatever I`m trying.