https://dagster.io/ logo
Title
j

James Hale

10/05/2022, 6:27 PM
Hello - is there a pattern for sharing resources between Assets/Ops and IOManagers? E.g., I'd like to share the same connection configuration for Snowflake between an Op (for queries) and the IOManager (to write results to a table) that is handling the output of that Op. Our current solution below (note the implementation of the Snowflake IOManager and resource are bespoke, not from dagster-snowflake):
snowflake_config = {...}

# ...

resource_defs = {
    "snowflake_io_manager": snowflake_io_manager.configured(snowflake_config),
    "snowflake_resource": snowflake_resource.configured(snowflake_config),
}
:dagster-bot-resolve: 1
s

Sean Lopp

10/05/2022, 6:44 PM
You could abstract snowflake_config into its own resource Then for ops and assets use
required_resource_key
to indicate the additional dependency, and within the io manager and snowflake resource you'd follow this pattern https://docs.dagster.io/concepts/resources#resource-to-resource-dependencies
j

James Hale

10/05/2022, 6:51 PM
Thanks @Sean Lopp