DRDataRaft/ docs
GitHub ↗

H06 Inspect a failed delivery

H06Data, products and quality1 step

Use your current course session. Preparation and course runner · R script ↓

H06 Inspect a failed delivery

Goal: Find the exact failing row.

Prerequisites: H05.

stop_on_failure=FALSE returns a blocked run that you can inspect. Do not collect a blocked run with dr_collect.

training_step(
  "H06",
  {
    bad_policies <- policies
    bad_policies$premium[2] <- -150
    failed_run <- dr_run(
      policy_product,
      data = bad_policies,
      write = FALSE,
      stop_on_failure = FALSE
    )
    print(dr_quality_report(failed_run))
    print(dr_quality_rows(failed_run))
    last_failure <- dr_last_failure()
    stopifnot(
      failed_run$status == "blocked",
      last_failure$run_id == failed_run$run_id
    )
  },
  needs = c("H05")
)

Expected result: Policy 2 violates nonnegative; the course continues.

Task: In a copy, also give policy 4 a negative premium.

Show solution

Two rows now fail. Keep failed_run as the original single-row example for later exercises.

Search documentation

Search functions, packages and guides.