The same selection syntax works in the UI's search box, in dg launch --assets, in dg list defs --assets and in jobs. Its parts:
- Attributes:
key:revenue, key:raw_* (wildcard), group:sales, tag:pii or tag:tier=gold, kind:python, owner:team:finance.
- Layers:
+key:revenue adds one layer upstream, 2+key:revenue two; key:paid_orders+ one layer downstream, key:paid_orders+2 two.
- Logic:
and, or, not and parentheses. group:sales and not tag:pii is the sales assets without personal data.
- Functions:
sinks(group:sales) keeps the selected assets nothing else in the selection depends on; roots(...) keeps those with no selected parents.
In Python, dg.AssetSelection expresses the same: dg.AssetSelection.groups("sales") - dg.AssetSelection.tag("pii", ""). When a selection matches nothing, Dagster says so instead of launching an empty run.
Three selections against the shop graph.