This commit is contained in:
Youngjoon Lee 2024-09-26 11:05:23 +09:00
parent 8eb4348594
commit b495b6852a
No known key found for this signature in database
GPG Key ID: 167546E2D1712F8C

View File

@ -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());
}