Hello! I have created a couple of assets with `Ass...
# ask-community
a
Hello! I have created a couple of assets with
AssetsDefinition.from_graph(my_graph)
, but I cannot find how to set an
io_manager
on these assets different from the default one. Is this doable? Shall I edit the graph or can I act directly on the newly generated asset? Thank you 🙏
dagster bot responded by community 1
j
Hi, I think you can use
with_resources
function for each asset by passing the
io_manager
you want in the
resource_defs
argument.
a
Hi @Jordan thanks a lot for your answer. I believe changing this would also change the default
io_manager
for all other assets in the pipeline. I would ideally like to just change the io manager for these specific assets. For example, my situation resembles the following:
Copy code
@repository
def my_repo():
  my_new_asset = AssetsDefinition.from_graph(my_graph)
  assets_with_standard_io = [asset1, asset2]
  assets_with_parquet_io = with_resources(
    [asset3, asset4],
    resource_defs={"s3_parquet_io_manager": s3_parquet})
  return [my_new_asset, assets_with_standard_io, assets_with_parquet_io]
Right now
my_new_asset
is using the default io, which is
io_manager
. I would like to switch and use the
s3_parquet_io_manager
instead, without impacting
asset1
and
asset2
I think have found a solution – I could provide
output_defs
in the graph and specify the
io_manager_key
. I'll give this a try
d
Just fyi - this works! It's important not to forget to specify the dagster_type in case your IO Manager is type-dependent
a
I forgot to update the thread, it does work indeed! Thanks a lot for the advice Daniel dagster spin