Hello lovely support. I think I may have found a b...
# ask-community
Hello lovely support. I think I may have found a bug. I’m trying to create an Asset from a graph. We use the
IO Manager. Here’s a close version of my code:
Copy code
import os

from dagster import op, graph, AssetsDefinition, ResourceDefinition
from dagster_gcp import bigquery_resource, gcs_resource
from dagster_gcp.gcs.io_manager import gcs_pickle_io_manager

def upstream_op():
    return 1

def downstream_op(upstream_op):
    return upstream_op + 1

def my_graph():
    return downstream_op(upstream_op())

asset_definition = AssetsDefinition.from_graph(
        "gcs_bucket": ResourceDefinition.hardcoded_resource(os.getenv("BUCKET", "bucket")),
        "gcs": gcs_resource,
        "bigquery": bigquery_resource,
        "io_manager": gcs_pickle_io_manager,
The error I’m getting:
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.
I’m not sure I understand what this error means. I tried a couple different things but I was not able to fix it 😞 Any help is greatly appreciated
Hi Chris, how are you adding this asset to the repository? Does it exist in a job or is it wrapped with
? This issue often arises because resources are scoped at the repository level (in order to power the global "materialize" button) so a given resource key must have the same value throughout the repository. One workaround would be to provide a per-output IO manager key for your graph-backed asset, like the example here.
Hey @claire thanks. You set me on the right trajectory. I didn’t realize
would detect
. I managed to fix the bug and make our code way simpler and cleaner 🙂 thanks
🌈 1