Hi, I have a question regarding DT assets which I ...
# ask-community
b
Hi, I have a question regarding DT assets which I didn't find in the docs. Assuming that I loaded my DBT assets:
Copy code
dbt_assets = load_assets_from_dbt_project(
    project_dir=DBT_PROJECT_PATH, profiles_dir=DBT_PROFILES, key_prefix=["jaffle_shop"]
)
How can I access/modify models as individual assets (to add metada, versioning, plots etc.)? mock example:
Copy code
@asset
def customers_dbt_asset(dbt_asset = customers, key_prefix=["jaffle_shop"], group_name="staging"):
    return customers
s
Hey @Bartosz Kopytek - check out the parameters on
load_assets_from_dbt_project
- there are a few that let you choose a group name, record runtime metadata, etc. Let me know if there's anything missing there that you need
b
@sandy sounds fine, but what if I would like to set different freshness policy on different dbt models? Is that possible?
@sandy Oh I think I get it, I would need to select/exclude them, and then for example combine them in the DAG, right?
s
take a look at the documentation for the
node_info_to_freshness_policy_fn
argument of the method I mentioned above. it discusses how you can set freshness policies inside dbt by using dbt config.
🌈 1
b
Awesome, thanks!