How to get all asset keys of assets that are in a particular group? #27312
-
How can I fetch all the asset keys of assets that are in a particular group (have a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There's a way to do that using AssetSelection syntax: group_selection = AssetSelection.groups("some_group")
asset_keys = selection.resolve(context.repository_def.asset_graph) You can also get the asset key of the most downstream asset within a group using sinks. A sink asset is an asset that has no downstream dependencies within the asset selection. The sink asset can have downstream dependencies outside of the asset selection. downstream_asset_in_group_selection = AssetSelection.groups("some_group").sinks()
asset_keys = selection.resolve(context.repository_def.asset_graph) You can also get the asset key of the most upstream asset within a group using roots(). A root asset is an asset that has no upstream dependencies within the asset selection. The root asset can have downstream dependencies outside of the asset selection. upstream_asset_in_group_selection = AssetSelection.groups("some_group").roots()
asset_keys = selection.resolve(context.repository_def.asset_graph) |
Beta Was this translation helpful? Give feedback.
There's a way to do that using AssetSelection syntax:
You can also get the asset key of the most downstream asset within a group using sinks. A sink asset is an asset that has no downstream dependencies within the asset selection. The sink asset can have downstream dependencies outside of the asset selection.
You can also get the asset key of the most upstream asset within a group using roots(). A root asset is an asset…