energy_data_retrieval.hydro_catalogue.replay#
Validate a complete reviewed enrichment batch before writing any JSONL shard.
- energy_data_retrieval.hydro_catalogue.replay.replay_reviewed(root, accepted, transform)[source]#
Reject duplicate/missing identities and transformation conflicts before writes.
The callback receives an existing record and its explicitly reviewed entry. Unreviewed records are preserved. This is validation-before-write, not a filesystem transaction; an I/O failure still requires deterministic replay.
- Parameters:
root (Path)
accepted (list[dict[str, Any]])
transform (Callable[[dict[str, Any], dict[str, Any]], dict[str, Any]])
- Return type:
int