Benjamin Faught
06/12/2023, 1:59 PMQwame
06/12/2023, 2:32 PMwith_resources
in the current API. You just pass the resource to Definitions
and you should be able to reference it from any other assetBenjamin Faught
06/12/2023, 4:49 PMQwame
06/12/2023, 6:35 PM@asset
def test_asset_with_dbt(dbt: DbtClientResource):
dbt.run(....)
)
owen
06/12/2023, 7:11 PMdbt_assets
. The assets that are created with load_assets_from_dbt_project
will need a resource bound to them, but this can happen when you're creating your Definitions
object. You can see an example project structure which incorporates dbt / a separate resources folder here: https://github.com/dagster-io/dagster/blob/master/examples/project_fully_featured/project_fully_featured/__init__.pyBenjamin Faught
06/12/2023, 8:11 PMdbt_resource = DbtCliClientResource(
project_dir=DBT_PROJECT_PATH,
profiles_dir=DBT_PROFILES,
)
can I use this resource as part of my dbt asset config in my assets folder?
dbt_assets = load_assets_from_dbt_project(
project_dir=DBT_PROJECT_PATH,
profiles_dir=DBT_PROFILES,
use_build_command=True,
)
rather than specifying the project_dir and profiles_dir in both? Hopefully that makes sense. Again, still trying to get some sea legs with it.Benjamin Faught
06/12/2023, 8:17 PMowen
06/12/2023, 8:21 PMload_assets_from_dbt_project
are used at definition time (to tell dagster what assets actually exist). If you were using load_assets_from_dbt_manifest
, the project/profiles dir wouldn't even be specified in the first place (as dagster would not need to compile the dbt project to understand what's in it -- it'd just read directly from the manifest)Benjamin Faught
06/12/2023, 8:25 PM