DRDataRaft/ docs
GitHub ↗

H14 Read saved data

H14Persistence and relationships1 step

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

H14 Read saved data

Goal: Use a fixed output version as a source.

Prerequisites: H13.

An explicit version pins the data. Omitting it would read the current version.

training_step(
  "H14",
  {
    rds_source <- dataraft.adapters::dr_source_rds(
      rds_path,
      version = rds_first$outputs$version
    )
    reloaded_product <- dr_product(
      "policies.reloaded",
      rds_source,
      contract = policy_contract
    )
    reloaded_rows <- dr_collect(dr_run(reloaded_product, write = FALSE))
    print(reloaded_rows)
    stopifnot(sum(reloaded_rows$premium) == 740)
  },
  needs = c("H13")
)

Expected result: The original premium total is still 740.

Task: What happens to this source after another delivery?

Show solution

It stays pinned to the first version. Test that next.

Search documentation

Search functions, packages and guides.