Darryl Ng
02/22/2024, 12:32 AMScout
02/22/2024, 12:32 AMAssetKey
into an array of strings that represent its subcomponents, you can access the path
attribute of the AssetKey
object. The path
attribute is a sequence of strings that represents the hierarchical structure of the asset_key
. Here's how you can do it based on the documentation: python from dagster import AssetKey # Assuming you have an AssetKey object my_asset_key = AssetKey(["project", "dataset", "table"]) # To get the array of strings (subcomponents) subcomponents = my_asset_key.path # subcomponents will be ["project", "dataset", "table"]
The path
attribute will give you the list of strings that make up the hierarchical structure of the AssetKey
. This list can be used to construct a fully qualified name (fqn) or for any other purpose where you need to access the individual components of the AssetKey
.