Is there anything special I need to do to get a dy...
# ask-community
Is there anything special I need to do to get a dynamic op called inside of a multi-asset to have access to it's context? Right now I'm trying to call the dynamic op
but get an error of
dagster._core.errors.DagsterInvalidInvocationError: Compute function of op 'observations' has context argument, but no context was provided when invoking.
(both versions of this error, if i don't provide the context from the multi-asset to the op it's line 169, if I do it's line 177 of
) Other assets and ops I have turned into assets in a graph handle context injection on their own so I do know that it should be handled behind the scenes.
I found an open issues of, after doing more searching through older messages, i'm going to assume that's what's happening here since it's still open and matches what i'm trying to do.
Hi again! Generally we don't support calling ops inside of assets -- instead, you can create an asset from an existing op using
. However, dynamic ops also won't really work with this, instead I'd recommend placing the dynamic op inside of a graph and then calling
. The return value of the graph also shouldn't be dynamic -- basically all the dynamic outputs need to be `collect`ed before they can be turned into an asset.
That's exactly what I ended up doing, moving away from
s and
decorators and into a
and it works perfectly fine, op calling context and all. So if anyone else runs into this issue here's the solution for now 😛
🌈 1
🙏 1