From b495b6852a96fbbc20745f976f4925b8b48f8a7f Mon Sep 17 00:00:00 2001 From: Youngjoon Lee <5462944+youngjoon-lee@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:05:23 +0900 Subject: [PATCH] use f64 --- mixnet/ordering/src/bin/latency.rs | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/mixnet/ordering/src/bin/latency.rs b/mixnet/ordering/src/bin/latency.rs index 520eba1..768bf9c 100644 --- a/mixnet/ordering/src/bin/latency.rs +++ b/mixnet/ordering/src/bin/latency.rs @@ -23,16 +23,22 @@ fn aggregate(path: &str) { .finish() .unwrap(); - aggregated_series - .extend( - &df.column("latency") - .unwrap() - .f64() - .unwrap() - .clone() - .into_series(), - ) - .unwrap(); + match &df.column("latency").unwrap().f64() { + Ok(col) => { + aggregated_series + .extend(&(*col).clone().into_series()) + .unwrap(); + } + Err(PolarsError::SchemaMismatch(_)) => { + let col = &df.column("latency").unwrap().i64().unwrap(); + aggregated_series + .extend(&col.cast(&DataType::Float64).unwrap()) + .unwrap(); + } + Err(e) => { + panic!("Error: {}", e); + } + }; println!("Processed {}", file.display()); }