Hi :wave: , I keep running into the error “Attribu...
# ask-community
j
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
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
What if you can’t access the inners of the op because it’s an op defined by a plugin?
z
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
Thanks for your help