Hello! I made these two assets using the same grap...
# ask-community
e
Hello! I made these two assets using the same graph of ops via this code:
Copy code
cleaned_data_bank_loan = AssetsDefinition.from_graph(clean_data_graph, key_prefix=["source", "bank_loan"])
cleaned_data_bank_marketing = AssetsDefinition.from_graph(clean_data_graph, key_prefix=["source", "bank_marketing"])
Is there in any way that I can modify the name of the asset? I only found a way of modifying the key_prefix but not the actual name. These two assets basically have the same logic of how they would materialize and as such, I created a graph and derived these two assets. Later on, I plan to supply it with arguments via run config to specify what's the location of the asset it's going to materialize.
c
Hi Ryan. You can specify a different output asset key for each
AssetsDefinition.from_graph
instance by doing something like this:
Copy code
AssetsDefinition.from_graph(my_graph, keys_by_output_name={"result": AssetKey("asset_1")}),
AssetsDefinition.from_graph(my_graph, keys_by_output_name={"result": AssetKey("asset_2")}),
Here
result
is the output name of the graph.
e
Thank you so much, claire. Can confirm that this works