Running into an error making a repo with assets. `...
# ask-community
y
Running into an error making a repo with assets.
Copy code
dagster.core.errors.DagsterInvalidDefinitionError: resource with key 'score_maps' required by op 'scope12_scores' was not provided. Please provide a <class 'dagster.core.definitions.resource_definition.ResourceDefinition'> to key 'score_maps', or change the required key to one of the following keys which points to an <class 'dagster.core.definitions.resource_definition.ResourceDefinition'>: ['io_manager']



assets_list = [
    scope1_norms, scope2_norms,
    scope3_norms, energy_use,
    renewables_produced, renewables_purchased,
    scope12_norms, scope12_scores, scope3_scores, ...]

r_defs={
    "esgdata": esg_io,
    "score_maps": score_maps_dicts,
    "score_version_settings": version_settings,
    "secmaster_db": secmaster_db, "solutions_orgpermids": soln_opids,
    "io_manager": gcs_iom,
    "gcs": gcs_r
}

@repository
def repo():
    return [
        *with_resources(
            definitions=assets_list,
            resource_defs=r_defs
        ),
        *assets_list]
when I had defined it with AssetGroup passing
resource_defs
it worked, though.
Copy code
leadlag = AssetGroup(
    [ci.scope12_norms, ci.scope12_scores, ci.scope3_scores,
    ci.carbon_reporting, ci.carbon_reporting_score,
    ti.renewables_produced_percent...],
    source_assets=[
        ci.scope1_norms, ci.scope2_norms,
        ci.scope3_norms, ti.energy_use,
        ti.renewables_produced, ti.renewables_purchased],
    resource_defs={
        "esgdata": esg_io,
        "score_maps": score_maps_dicts, "score_version_settings": version_settings,
        "secmaster_db": secmaster_db, "solutions_orgpermids": soln_opids,
        "io_manager": gcs_iom,
        "gcs": gcs_r
    })
p
Did you want to include both the assets with resources and assets without resources in your repo? Usually you just want to include something like this:
Copy code
@repository
def repo():
    return [
        # include all of the assets bound to resources
        *with_resources(assets_list, resource_defs=r_defs),

        # do not include the unbound assets here
        # *assets_list 
    ]
I’m wondering if it’s finding the asset declaration that isn’t bound to a resource and complaining….
y
Oh yes, that is what it was. Thanks! Looks like I def need to define a job, too.