dr_freshness()
Release identity follows catalog publication order, independently of writer
clocks. Publication timestamps still determine displayed age. Historical
exported snapshots also require a publication sequence.
Freshness is
unknown when the release has no matching versioned contract
with a declared max_age_hours, including model releases without that SLA.
Usage
dr_freshness(lake, at = Sys.time())Arguments
- lake
- Connected lake.
- at
- Evaluation time.
Value
Tibble of published assets with latest attempt and freshness.
Examples
\dontshow{if (requireNamespace("dataraft.lake", quietly = TRUE) && requireNamespace("duckdb", quietly = TRUE) && requireNamespace("bit64", quietly = TRUE)) withAutoprint(\{ # examplesIf}
root <- tempfile("dataraft-example-")
config <- dataraft.lake::dr_lake_config(
dataraft.lake::dr_registry_duckdb(file.path(root, "lake.db")),
dataraft.lake::dr_storage_local(file.path(root, "data")),
landing = file.path(root, "landing"), backend = "duckdb"
)
lake <- dataraft.lake::dr_connect_lake(config)
path <- file.path(root, "orders.csv")
utils::write.csv(data.frame(order_id = 1:2, amount = c(25, 75)), path,
row.names = FALSE)
source <- dataraft.core::dr_source_file("orders.file", path, reader = utils::read.csv)
contract <- dataraft.core::dr_contract(
"orders", version = "1.0.0", columns =
c(order_id = "integer", amount = "numeric"), key = "order_id"
)
release <- dataraft.core::dr_product("orders", contract = contract, code_version = "v1") |>
dataraft.core::dr_add_source(source) |> dataraft.core::dr_publish(to = lake)
dr_freshness(lake)
dataraft.lake::dr_disconnect_lake(lake)
unlink(root, recursive = TRUE)
\dontshow{\}) # examplesIf}Documentation source snapshot · View source at 2f9432d ↗
Code examples are documented source examples; they are not executed in this website build.
Code examples are documented source examples; they are not executed in this website build.