H19 Check a model as a product
Use your current course session. Preparation and course runner · R script ↓
H19 Check a model as a product
Goal: Validate relationships together.
Prerequisites: H18.
dr_model_product binds a dm model. The failure exercise replaces just one member table.
training_step(
"H19",
{
model_product <- dr_model_product("portfolio", portfolio_model)
model_run <- dr_run(model_product, write = FALSE)
print(dr_collect(model_run))
orphan_run <- dr_run(
model_product,
sources = list(customers = customers[1:2, ]),
write = FALSE,
stop_on_failure = FALSE
)
print(dr_quality_report(orphan_run))
stopifnot(model_run$status == "completed", orphan_run$status == "blocked")
},
needs = c("H18")
)Expected result: The complete model runs; removing customer 3 breaks the relationship. Without explicit table contracts this is not complete business validation.
Task: Which policies are affected?
Show solution
Policies 5 and 6 refer to customer 3.