Run all version comparison checks between two dataset snapshots
Source:R/compare.R
run_comparison_checks.RdRuns CP-01 to CP-08 comparing a current delivery against the previous one.
Usage
run_comparison_checks(
df_current,
df_previous,
config,
types_current = NULL,
types_previous = NULL
)Arguments
- df_current
A data frame. The current delivery.
- df_previous
A data frame. The previous delivery.
- config
Named list. Merged configuration as returned by
load_config.- types_current, types_previous
Optional named character vectors of pre-resolved column types for the current and previous data frames (as produced by
resolve_col_typeper column). WhenNULL(the default), types are resolved once here and shared by all type-dependent comparison checks.
Value
A list of dq_result objects. The list carries
attributes new_cols, dropped_cols, and
type_changed_cols (character vectors) for use by the snapshot
writer.
Examples
cfg_dir <- system.file("demonstrations/config", package = "dqcheckr")
cfg <- load_config("starwars_csv", config_dir = cfg_dir)
curr_path <- system.file("demonstrations/data2/starwars_v2.csv", package = "dqcheckr")
prev_path <- system.file("demonstrations/data2/starwars_v1.csv", package = "dqcheckr")
curr <- read_dataset(curr_path, cfg)
prev <- read_dataset(prev_path, cfg)
results <- run_comparison_checks(curr, prev, cfg)