Do ops allow dynamic input types? When I try to de...
# ask-community
e
Do ops allow dynamic input types? When I try to define an input as a Union of 2 types, I get "DagsterInvalidDefinitionError: Problem using type 'typing.Union[typing.List[typing.Dict], pandas.core.frame.DataFrame]' from type annotation for argument 'examples', correct the issue or explicitly set the dagster_type via In()"
The error message does not specify the issue that I'm supposed to be correcting, so I'm not sure how to proceed?
j
hey @Eric Loreaux can you share a code sample?
e
Hi Jamie, I redesigned the pipeline to move away from relying on a Union of types, which resolved the issue. Based on your response, I'm assuming that dagster should support unions as op arg types or return types?
j
You might need to define a custom dagster type, but it’s hard to know if you need to do that or if there’s another syntax issue without looking at the code
e
Got it, thanks. It does seem like the error message I encountered could be made to be slightly more informative. I will revive this thread if I encounter the issue again