:wave: Is it possible in dagster to define an asse...
# ask-community
👋 Is it possible in dagster to define an asset selection which, given a set of assets, it selects only the leaf assets, ie the assets which do not have any downstream asset in the dag? example: let’s say that I have an asset selection which contains the assets A, B, C, and the dag is A -> B -> C, how can I get only asset C?
here is some more context: I have a
which takes all the dbt models that I want to run. All these models have to run before a downstream asset
can run. I’ve put this asset selection as
for my downstream asset
, but then my dag gets overly complicated because there is a direct link between ALL my dbt models to
, so ideally I just want to simplify the dag by creating a dependency between the leaves of the dag given from dbt to my asset
so the situation right now is something like this: let’s say the dag from dbt is A -> B -> C and my downstream asset is Z, then the dag looks like
Copy code
A -> B -> C
|    |    |
v    v    v
Z    Z    Z
but I would like to get
btw I’ve already asked in dbt workspace if it is possible to select leaves of a dag but in dbt it’s not possible
Hi Riccardo. You could do
function searches within the existing asset selection and returns all assets that do not have any downstream dependencies within the existing selection.
🎉 1