batch_mode_batch_triple/
ensure_input_matches_output.rs

1// ---------------- [ File: src/ensure_input_matches_output.rs ]
2crate::ix!();
3
4impl BatchFileTriple {
5
6    pub async fn ensure_input_matches_output(&self) 
7        -> Result<(), BatchValidationError> 
8    {
9        // Load input and output files
10        let input_data  = load_input_file(self.input().as_ref().unwrap()).await?;
11
12        let output_data = load_output_file(self.output().as_ref().unwrap()).await?;
13
14        // Compare request IDs
15        let input_ids:  HashSet<_> = input_data.request_ids().into_iter().collect();
16
17        let output_ids: HashSet<_> = output_data.request_ids().into_iter().collect();
18
19        if input_ids != output_ids {
20            return Err(BatchValidationError::RequestIdsMismatch {
21                index:      self.index().clone(),
22                input_ids:  Some(input_ids),
23                output_ids: Some(output_ids),
24                error_ids:  None,
25            });
26        }
27
28        info!("for our batch triple {:#?}, we have now ensured the input request ids match the request ids from the output file",self);
29
30        Ok(())
31    }
32}