Julius
05/05/2023, 10:38 AMGuy McCombe
05/05/2023, 10:45 AMdef test_asset_factory(
model: str, non_argument_deps: set[AssetKey] | set[str] | None
) -> AssetsDefinition:
@asset(
name=f"test_{model}",
non_argument_deps=non_argument_deps,
required_resource_keys={"dbt"},
group_name="dbt_tests",
key_prefix="dbt_project",
compute_kind="dbt",
)
def _asset(context: OpExecutionContext) -> DbtCliOutput:
res = context.resources.dbt.test(models=[model])
return res
return _asset
test_assets = [
test_asset_factory(**kwargs)
for kwargs in [
...
]
]
Guy McCombe
05/05/2023, 10:48 AMGuy McCombe
05/05/2023, 10:51 AMBenoit Perigaud
05/05/2023, 1:04 PMGuy McCombe
05/05/2023, 1:07 PMJulius
05/05/2023, 1:30 PMuse_build_command
, but for some reason, the jobs don't catch the dbt-test if it is a failure test. I also want whole job fails when dbt-test fail.Nicolas Luchetti
05/05/2023, 1:50 PMBenoit Perigaud
05/05/2023, 1:52 PMbuild
, if a test fails, the dbt command will skip the downstream model and Dagster will report an error.Julius
05/05/2023, 1:57 PMuse_build_command
. Did you use the lastest version of dbt-dagster?Julius
05/05/2023, 1:57 PMBenoit Perigaud
05/05/2023, 1:59 PMNicolas Luchetti
05/05/2023, 2:01 PMuse_build_command
do you include it in the job.py?Julius
05/05/2023, 2:10 PMuse_build_command
Nicolas Luchetti
05/05/2023, 2:15 PMJulius
05/05/2023, 2:16 PM