https://dagster.io/ logo
#ask-community
Title
# ask-community
j

Jacob Marcil

08/15/2023, 7:56 PM
Hey is it possible to configuration certain aspect of an IO Manager in the asset a other parameters in the Definition of the ressources itself? I would love do configure the bucket name like this
Copy code
RESOURCES_SANDBOX = {
    "new_s3_io_manager": s3_csv_io_manager.configured(
        {
            's3_bucket': "my-aws-bucket",
        }
    ),
}
And then in the asset configure other parameters like
Copy code
@asset(
      io_manager_key="new_s3_io_manager",
      parameters = {'my_io_manager_format': 'xyz', 'my_io_partition_prefix_file_name': 'this_is_my_prefix'}
)
🤖 1
s

sean

08/15/2023, 9:02 PM
Hi Jacob, it’s not possible to directly configure the IO manager via the asset definition. However, if you write a custom IO manager you can access
metadata
defined on the asset via the
OutputContext
-- we do this in `DbIOManager`: https://github.com/dagster-io/dagster/blame/master/python_modules/dagster/dagster/_core/storage/db_io_manager.py You could use this to implement something like you’re looking for,
parameters
would need to be formatted as asset metadata. That said, it’s not a well-supported pattern so I would avoid unless you really want to experiment.