DRDataRaft/ docs
GitHub ↗

Define a product

Describe the delivery

A contract makes the schema explicit. Here each row represents one order and id is the key.

library(dataraft)
contract <- dr_contract("orders",
  columns = c(id = "integer", amount = "numeric"), key = "id")
orders <- dr_product("orders", contract = contract, owner = "Analytics") |>
  dr_add_quality(dr_quality(~ amount >= 0, action = "block"))

The contract describes the columns and key. The quality rule rejects negative amounts. You can add preparation steps later if the data needs them.

Inspect the definition before execution

dataraft.core::dr_plan(orders)
dataraft.core::dr_validate(orders)

These inspect the definition and its configuration. They do not establish the quality of a delivery. Without a declared contract, inferred schema checks are labelled unvalidated.

Search documentation

Search functions, packages and guides.