Duke
03/05/2024, 10:20 PMScout
03/05/2024, 10:20 PMAssetKey
, you would typically access the last component of the asset key's path. An AssetKey
is represented as a list of strings that define the hierarchical path of the asset. The asset name is usually the last element in this list. Based on the documentation, if you have an AssetKey
like AssetKey(["foo", "bar", "baz"])
, and you want to extract the name "baz" as text, you would access the last element of the list: python asset_key = AssetKey(["foo", "bar", "baz"]) asset_name = asset_key.path[-1]
In this example, asset_name
would be the string "baz", which is the name of the asset. Please note that this approach assumes that the asset name is the last component of the AssetKey
. If your use case involves a different structure for asset keys, you would need to adjust the method of accessing the asset name accordingly.