https://dagster.io/ logo
#dagster-support
Title
# dagster-support
z

Zach

01/18/2023, 2:17 AM
when creating a graph-backed asset, where does the asset derive its name from? I'm trying to give the asset a different name than the graph that it is created from, but am having trouble figuring out where to configure it. I have the asset with an asset job set up like this:
Copy code
custom_htp_asset = with_resources(
    [
        AssetsDefinition.from_graph(
            htp_cross_platform_graph,
            group_name="UAF_results",
        )
    ],
    resource_defs=resource_defs_prod,
)[0]
custom_htp_asset_job = define_asset_job(
    name="custom_htp_asset_job",
    selection=AssetSelection.groups("UAF_results"),
    tags={"ecs/cpu": 1024, "ecs/memory": 4096},
)
I would like the asset produced from this graph to be named "UAF_results", but currently this is using the name of the graph "htp_cross_platorm_graph". the graph has a
GraphOut
configured like so:
Copy code
@graph(out=GraphOut("UAF_results"))
def htp_cross_platform_graph():
    ...
I have another graph-backed asset that seems to use the name of the
GraphOut
to name the asset, but it doesn't seem to be working that way in this case...
v

Vinnie

01/18/2023, 7:09 AM
You can pass the parameter
keys_by_output_name={"result": "UAF_results"}
to
from_graph
, that way you don’t even need to define the
GraphOut
.
z

Zach

01/18/2023, 4:26 PM
thanks, I'll give that a try
c

chris

01/18/2023, 6:46 PM
Just some clarifications here; an
AssetsDefinition
doesn’t have a name, it has a set of asset keys associated with it. In the case of a graph backed asset, you define the asset keys associated with that asset based on which outputs that graph produces, hence the need for
keys_by_output_name