I would like to set `io_manager_key` and `metadata...
# ask-community
r
I would like to set
io_manager_key
and
metadata
after creating an asset from graph. Example:
Copy code
my_asset = AssetsDefinition.from_graph(my_graph)
How do I set
io_manager_key
and
metadata
on
my_asset
?
dagster bot responded by community 1
v
You can pass
metadata_by_output_name
to the
from_graph
method (https://docs.dagster.io/_apidocs/assets#dagster.AssetsDefinition.from_graph) but as far as I know there isn’t a way to set the IO manager. My workaround is to set it on the
op
that leads to the result, e.g.
Copy code
@op(out=Out(my_cool_type, io_manager_key="my_cool_io_manager"),)
def my_cool_op(data):
    return do_something_cool(data)

@graph
def my_cool_graph():
    data = ...
    return my_cool_op(data)