H29 Compare deliveries
Use your current course session. Preparation and course runner · R script ↓
H29 Compare deliveries
Goal: Retain a deliberate data change in history.
Prerequisites: H28.
The comparison uses policy_id as the business key.
training_step(
"H29",
{
lake_second_data <- policies
lake_second_data$premium[1] <- 110
lake_second <- dr_publish(
lake_product,
data = lake_second_data,
business_date = "2026-08-31"
)
lake_difference <- dataraft.lake::dr_compare(
lake_first,
lake_second,
key = "policy_id"
)
print(lake_difference)
stopifnot(sum(dr_collect(lake_second)$premium) == 750)
},
needs = c("H28"),
enabled = training_options$lake,
optional = TRUE
)Expected result: Policy 1 changed; the new total is 750.
Task: Why do both runs have the same business_date?
Show solution
They are different delivery versions for the same business date.