Skip to content

Commit e027018

Browse files
committed
fix: added data clearing to period_union
1 parent c3b178f commit e027018

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎aw-transform/src/period_union.rs‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use super::sort::sort_by_timestamp;
22
use aw_models::Event;
3-
use chrono::{DateTime, Utc};
43
use std::collections::VecDeque;
54

65
/// Takes a list of two events and returns a new list of events covering the union
@@ -47,11 +46,13 @@ pub fn period_union(events1: &[Event], events2: &[Event]) -> Vec<Event> {
4746
}
4847
}
4948

50-
// for event in merged_events:
51-
// # Clear data
52-
// event.data = {}
53-
5449
events_union
50+
.drain(..)
51+
.map(|mut e| {
52+
e.data = json_map! {};
53+
e
54+
})
55+
.collect()
5556
}
5657

5758
#[cfg(test)]

0 commit comments

Comments
 (0)