https://dagster.io/ logo
#ask-community
Title
# ask-community
j

Jeyaram Muthukumar

02/27/2023, 7:38 AM
Hi Team I need some idea how to group dbt assets based on subfolders inside models folder.
t

Tim Castillo

02/27/2023, 5:53 PM
Hi! tl;dr:
node_info_to_group_fn
docs here Great question. Are you using the
dagster-dbt
integration library? When you use any of the functions that load assets from a dbt project (ex.
load_assets_from_dbt_project
, there is a parameter you can pass in called
node_info_to_group_fn
. It takes a function that maps the dbt node info to return back what Dagster group a model should be in. For more information about the shape of that node object, here is what dbt's JSON schema offers. Based on your question, the value of
original_file_path
should be your best bet to help you decide what the group should be. https://schemas.getdbt.com/dbt/manifest/v8/index.html#nodes_additionalProperties_oneOf_i3_original_file_path