https://dagster.io/ logo
#dagster-support
Title
# dagster-support
g

geoHeil

12/15/2022, 8:18 PM
How can I access metadata in an op? AttributeError: 'OpExecutionContext' object has no attribute 'metadata'
j

jamie

12/15/2022, 9:42 PM
how are you providing metadata? on the job? somewhere else?
g

geoHeil

12/15/2022, 10:04 PM
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

jamie

12/16/2022, 2:58 PM
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
2 Views