When using `with_resources` with the `resource_con...
# ask-community
c
When using
with_resources
with the
resource_config_by_key
kwarg, the resource_defs for which the config is provided are mutated to new objects. This leads to errors like the below if there are other assets that use the same resource_defs w/ the same key. Any thoughts on this? Should I only use
with_resources
once around all my assets?
Copy code
dagster._core.errors.DagsterInvalidDefinitionError: Conflicting versions of resource with key 'io_manager' were provided to different assets. When constructing a job, all resource definitions provided to assets must match by reference equality for a given key.
c
hmmm good catch
limiting the number of calls to
with_resources
is ideal, yes. I think there's probably a workaround here though, if you provide the same resource config and the same resource definition to two different calls to
with_resources
, we should be able to reconcile that
mind filing an issue?
c
Sure will do
I see on the reconciliation part. I had a graph backed asset (using experimental resource_defs) and a dbt asset (using with_resources) selected in the same job.
c
And the resource defs were logically the same? (As in, same config, same code?)
c
Yes
c
gotcha