% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ops.R
\name{ops_snapshot}
\alias{ops_snapshot}
\title{Record and review dataset pipeline snapshots}
\usage{
ops_snapshot(
  data = NULL,
  label = NULL,
  reset = FALSE,
  verbose = TRUE,
  check_na = TRUE
)
}
\arguments{
\item{data}{A data.frame or data.table to snapshot. Pass \code{NULL} (or omit)
to print the full snapshot history without recording a new entry.}

\item{label}{(character) A short name for this pipeline stage, e.g.
\code{"raw"}, \code{"after_derive_missing"}. Defaults to \code{"snapshot_N"} where N
is the sequential index.}

\item{reset}{(logical) If \code{TRUE}, clears the entire snapshot history and
returns invisibly. Default \code{FALSE}.}

\item{verbose}{(logical) Print the CLI report. Default \code{TRUE}.}

\item{check_na}{(logical) Whether to count columns with any \code{NA} or blank
string values and include the delta in the report. Set to \code{FALSE} to skip
the NA scan (useful for large datasets or when NA tracking is not needed).
Default \code{TRUE}.}
}
\value{
When \code{data} is supplied, returns the new snapshot row invisibly
(a one-row data.table). When called with no \code{data}, returns the full
history data.table invisibly.
}
\description{
Captures a lightweight summary of a data.frame at a given pipeline stage
and stores it in the session cache. Subsequent calls automatically compute
deltas against the previous snapshot, making it easy to track how data
changes through \verb{derive_*}, \verb{assoc_*}, and other processing steps.
}
\examples{
dt <- ops_toy(n = 100)
ops_snapshot(dt, label = "raw")

dt <- derive_missing(dt)
ops_snapshot(dt, label = "after_derive_missing")

# View full history
ops_snapshot()

# Reset history
ops_snapshot(reset = TRUE)
}
