How can I access metadata in an op? AttributeError...
# ask-community
g
How can I access metadata in an op? AttributeError: 'OpExecutionContext' object has no attribute 'metadata'
j
how are you providing metadata? on the job? somewhere else?
g
The metadata is assigned to
@asset
context.op_def.output_defs[0].metadata
is a workaround - but not nice. And
context.metadata
fails with the aforementioned exception
j
you could also try
Copy code
context.get_output_metadata("result")
which will get the metadata for the output
result
which is the default name of the output for the asset