
Remap audit trail row IDs from unique-string slice to parent dataset
Source:R/cleaning_pipeline.R
remap_audit_to_parent.RdWhen a step function runs on a deduplicated slice of a dataframe, its audit trail contains row IDs 1..n_unique. This function expands those IDs back to the full set of matching parent rows, producing an audit trail with correct row IDs relative to the original (parent) dataframe.
Arguments
- audit_slice
6-column audit tibble from the deduped unique-string slice. Row IDs are positions 1..n_unique within the unique slice.
- parent_map
Named list where names are character representations of positions in the unique slice ("1", "2", ...) and values are integer vectors of ALL parent row IDs that mapped to that unique value. Use original row IDs when lineage is available, otherwise parent row positions.