H09 Attach a recipe to a product
Use your current course session. Preparation and course runner · R script ↓
H09 Attach a recipe to a product
Goal: Compose a definition and inspect its plan.
Prerequisites: H08.
Attach the recipe directly to the product. There is no need for an empty workflow builder.
training_step(
"H09",
{
prepared_product <- policy_product |> dr_add_recipe(rounding_recipe)
print(dr_plan(prepared_product))
prepared_run <- dr_run(
prepared_product,
data = precise_policies,
write = FALSE
)
prepared_rows <- dr_collect(prepared_run)
print(prepared_rows)
stopifnot(prepared_rows$premium[1] == 100.13, policies$premium[1] == 100)
},
needs = c("H08")
)Expected result: Rounded output; the original delivery remains unchanged.
Task: When are product checks applied?
Show solution
They check the prepared candidate. Separate RAW input checks come later.