https://dagster.io/ logo
#ask-community
Title
# ask-community
j

James Tull

08/22/2023, 10:07 AM
Hi 👋 , I keep running into the error “AttributeError: ‘OpExecutionContext’ object has no attribute ‘bind’” when passing the context object around. In particular I’m calling an op from within an asset to do some transformation and passing the context into the op as a keyword argument. Is this not how the context should be used? Many thanks
z

Zach

08/22/2023, 1:51 PM
Yeah you can't call an op from within an asset or another op in Dagster. Ops are meant to be chained together in graphs but not directly reference one another. When I run into these situations I usually pull the inners of the op I want to call out into a vanilla python function and call that instead from the asset.
j

Josh Lloyd

09/05/2023, 8:28 PM
What if you can’t access the inners of the op because it’s an op defined by a plugin?
z

Zach

09/05/2023, 8:32 PM
You might be able to use
AssetsDefinition.from_op(<plugin_op>)
to create an asset out of it, and then add it as a step in your pipeline. But whether you can do that depends highly on your use case and what op you're trying to use
j

James Tull

09/08/2023, 9:52 AM
Thanks for your help
5 Views