Recommended way to load DBT assets #18525
-
|
Hey all, what is the recommended way to load DBT assets into Dagster? The tutorial uses the but there’s also this method How do I decide one over the other? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
In Explicitly: @dbt_assets(manifest=dbt_manifest_path)
def jaffle_dbt_assets(context: AssetExecutionContext, dbt: DbtCliResource):
print("I can run custom code before my dbt invocation")
yield from dbt.cli(["build"], context=context).stream()
print("I can run custom code after my dbt invocation")With We highly recommend that you use the Resources: |
Beta Was this translation helpful? Give feedback.
load_assets_from_dbt_projectwas the API for loading your dbt project as software-defined assets indagster-dbt<0.20.0. It was kept around for backwards compatability.In
dagster-dbt>=0.20.0, the@dbt_assetsdecorator andDbtCliResourcewas released. These two APIs give more flexibility when interacting with dbt and Dagster. One example of this flexibility is that you can modify the compute function of your@dbt_assetsdecorated function.Explicitly: