You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered a DagsterInvariantViolationError when trying to return a simple Python primitive (like a str) from an asset that utilizes PipesSubprocessClient. Here's the error message:
dagster._core.errors.DagsterInvariantViolationError: Compute function for op "download_from_url" yielded a value of type <class 'str'> rather than an instance of Output, AssetMaterialization, or ExpectationResult. Values yielded by ops must be wrapped in one of these types.
Surprisingly, when I remove the lines involving PipesSubprocessClient, everything works as expected and returns the string without errors.
What I Tried
The error message suggested that my function was behaving more like an op than an asset, so I adjusted my code to explicitly return an Output object instead of a plain string. After this change, it started working:
Why does using PipesSubprocessClient alter the behavior of the asset function?
Without it, returning a simple string works fine. With it, the function seems to require the use of an Output object.
Is this behavior intentional or a bug?
If intentional, it would be helpful for the documentation to clarify this distinction, as the current behavior is unexpected.
Why does the function behave more like an op when PipesSubprocessClient is involved?
This isn't immediately clear from the documentation or error message.
Looking forward to insights on whether this is expected behavior or if I'm missing something in the configuration.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I encountered a
DagsterInvariantViolationError
when trying to return a simple Python primitive (like a str) from an asset that utilizesPipesSubprocessClient
. Here's the error message:Here is my code:
Surprisingly, when I remove the lines involving
PipesSubprocessClient
, everything works as expected and returns the string without errors.What I Tried
The error message suggested that my function was behaving more like an op than an asset, so I adjusted my code to explicitly return an
Output
object instead of a plain string. After this change, it started working:Questions
Why does using PipesSubprocessClient alter the behavior of the asset function?
Without it, returning a simple string works fine. With it, the function seems to require the use of an Output object.
Is this behavior intentional or a bug?
If intentional, it would be helpful for the documentation to clarify this distinction, as the current behavior is unexpected.
Why does the function behave more like an op when PipesSubprocessClient is involved?
This isn't immediately clear from the documentation or error message.
Looking forward to insights on whether this is expected behavior or if I'm missing something in the configuration.
Beta Was this translation helpful? Give feedback.
All reactions