Timothee Vandeput
08/23/2022, 5:52 PMAdam Bloom
08/23/2022, 5:54 PMTimothee Vandeput
08/23/2022, 5:57 PMAdam Bloom
08/23/2022, 5:59 PMload_assets_from_dbt_project
, so you can just pass it directly! https://github.com/dagster-io/dagster/blob/master/python_modules/libraries/dagster-dbt/dagster_dbt/asset_defs.py#L377-L379Timothee Vandeput
08/23/2022, 6:04 PMdbt ls
and generate the manifest. But once the assets are generated, dagster is creating the dbt op in the background. That op is expecting a dbt resource that I can't change (see https://github.com/dagster-io/dagster/blob/9c481e193a1eac31b79cf4b8f8d3c38eac32ef3[…]/python_modules/libraries/dagster-dbt/dagster_dbt/asset_defs.py).Adam Bloom
08/23/2022, 6:07 PM@job(
resource_defs={
"dbt": dbt_configured,
})
and that's where you could have dbt_configured_a
and dbt_configured_b
, with both being referred to as dbt
within the op contextTimothee Vandeput
08/23/2022, 6:09 PM# Configure DBT
dbt_resource_config = dbt_cli_resource.configured(
{
"project_dir": DBT_PROJECT_A_DIR,
"profiles_dir": DBT_PROFILES_DIR,
}
)
resource_defs = {
"dbt": dbt_resource_config,
}
@repository
def mds_repo():
return with_resources(
load_assets_from_current_module(),
resource_defs=resource_defs,
) + [define_asset_job("all")]
But it won't work for one of the generated Op.Adam Bloom
08/23/2022, 6:14 PMTimothee Vandeput
08/23/2022, 6:17 PMchris
08/23/2022, 11:37 PMTimothee Vandeput
08/24/2022, 2:18 AM