V24 Review in the Data Viewer
Use your current course session. Preparation and course runner · R script ↓
Optional deep dive. Enable only the options named in each block, after preparing its packages or services.
V24a Inspect column lineage
Goal: Read static output-column dependencies.
Prerequisites: H08; extras.
Static analysis can be incomplete for dynamic R code. It is not presented as complete knowledge.
training_step(
"V24a",
{
column_recipe <- dr_recipe() |>
dr_step_mutate(annual_premium = premium * 12) |>
dr_step_select(policy_id, annual_premium)
print(dr_column_lineage(column_recipe, names(policies)))
},
needs = c("H08"),
enabled = training_options$extras,
optional = TRUE
)Expected result: annual_premium depends on premium.
Task: Must the recipe execute for this analysis?
Show solution
No. It is static analysis with corresponding limits.
V24b Select diagnostics
Goal: Separate run status from rule execution errors.
Prerequisites: H06; extras.
These functions inspect retained results without starting another run.
training_step(
"V24b",
{
print(dr_status(failed_run))
print(dr_quality_errors(failed_run))
print(dr_quality_counts(n_failed = 1, n_total = 6))
},
needs = c("H06"),
enabled = training_options$extras,
optional = TRUE
)Expected result: Blocked status. quality_errors may be empty because FALSE is not an R exception. quality_counts constructs counts for custom rules; it does not count a run automatically.
Task: Is a failure rate of 1/6 automatically acceptable?
Show solution
Only if an explicit business policy allows it.
V24c Use quality as a test expectation
Goal: Reuse the quality decision in tests.
Prerequisites: H05; testthat; extras.
dr_expect_quality uses the framework's quality decision in automated tests.
training_step(
"V24c",
{
quality_test_run <- dr_run(policy_product, write = FALSE)
dr_expect_quality(quality_test_run)
},
needs = c("H05"),
packages = c("testthat"),
enabled = training_options$extras,
optional = TRUE
)Expected result: No test failure for valid data.
Task: Should an intentional test failure go uncaught in the main path?
Show solution
No. Expect errors explicitly in testthat or inspect them as course results.
V24 Review in the Data Viewer
Goal: Open diagnostics interactively.
Prerequisites: H06; gui=TRUE; interactive R session.
The viewer shows bounded failing rows. No UI starts in batch mode.
training_step(
"V24",
{
if (interactive()) {
dr_review(failed_run, what = "rows", limit = 10)
}
if (interactive()) dr_review(failed_run, what = "report")
},
needs = c("H06"),
enabled = training_options$gui,
optional = TRUE
)Expected result: Failing rows or a quality report in the viewer.
Task: Does this start a new run?
Show solution
No. It uses the existing result.