Skip to main content

Groups

Groups are the most basic way to organize assets in Dagster.

Assigning a group​

Assets belong to the default group unless you set the group_name argument:

import dagster as dg


# Assets belong to the `default` group unless `group_name` says otherwise.
@dg.asset(group_name="marketing")
def marketing_summary(): ...


# `group_name` is also available on `AssetSpec`.
campaign_costs = dg.AssetSpec("campaign_costs", group_name="marketing")

group_name is accepted anywhere an asset is defined or modified, including AssetSpec, the group_name argument to load_assets_from_modules, the attributes of a defs.yaml file, and integration translators such as the dbt translator's get_group_name.

An asset can belong to only one group. To organize assets along several dimensions at once, use tags instead.

Nested groups​

A group name can contain / separators to place the group inside a hierarchy. Parent groups are implied by their children — you don't need to declare marketing for marketing/paid to exist:



# `/` separates the segments of a nested group name. The `marketing` and
# `marketing/paid` parent groups are implied by their children.
@dg.asset(group_name="marketing/paid/search")
def search_spend(): ...


@dg.asset(group_name="marketing/paid/social")
def social_spend(): ...


@dg.asset(group_name="marketing/email")
def email_sends(): ...

note

Nested group names require Dagster 1.13.9 or later.

Groups in the UI​

Groups can be used to organize the representation of assets in your asset graph. Each group is drawn as a labeled box around its assets, and a nested group is drawn as a box inside its parent's box. Clicking a group's header collapses it into a single node showing rolled-up status counts for everything inside, including any nested groups; clicking that node expands it again. The sidebar renders the same hierarchy as an expandable tree.