Currently working to incorporate metadata into `@m...
# ask-community
n
Currently working to incorporate metadata into
@multi_asset
output. Function generates four dataframes returned as assets. I am trying to add a preview of the dfs to the output via
context.add_output_metadata({'preview': MetadataValue.md(<http://df.to|df.to>_markdown())}
, however, because the function returns four dataframes, the
.add_output_metadata()
will not work. Here is the error I receive: `DagsterInvariantViolationError: Attempted to log metadata without providing output_name, but multiple outputs exist. Please provide an output_name to the invocation of
context.add_output_metadata
.`
y
add_output_metadata
is associated with a single output, so you’d need to specify an output that you want the metadata to attach to:
Copy code
context.add_output_metadata({'preview': MetadataValue.md())}, output_name="...")
n
Ah, I didn't realize
add_output_metadata
could take
output_name
as an arg. Feel kinda dumb now, lol. This works so thank you.