DRDataRaft/ docs
GitHub ↗

dr_contract_from()

Reads only a zero-row prototype for lazy tables. Required fields, keys, units and business rules are never inferred from sample values. The draft cannot be used for a quality gate or registered until explicitly confirmed.

Usage

dr_contract_from(
  data,
  id,
  owner = "",
  description = "",
  grain = "",
  version = "1.0.0",
  ...
)

Arguments

data
A data frame, lazy database table or Arrow table.


id
Contract identifier.


owner, description, grain
Optional business metadata.


version
Contract definition version.


...
Additional draft settings, such as key, required, rules, operator or column_metadata.

Value

A printable dr_contract_draft inheriting from contract.

Examples

draft <- dr_contract_from(data.frame(id = 1:2, amount = c(10, 20)),
  "orders", "Analytics", "Order amounts", "One order", key = "id")
contract <- dr_contract_confirm(draft)
dr_validate(data.frame(id = 1L, amount = 10), contract)

See also

dr_contract_confirm(), dr_contract_diff()
Documentation source snapshot · View source at d9cb454 ↗
Code examples are documented source examples; they are not executed in this website build.

Search documentation

Search functions, packages and guides.