(df: &DataFrame)
| 71 | } |
| 72 | |
| 73 | fn sort_ohlcv_df(df: &DataFrame) -> Result<DataFrame, String> { |
| 74 | df.sort( |
| 75 | ["symbol", "ts_us"], |
| 76 | SortMultipleOptions::new().with_order_descending_multi([false, false]), |
| 77 | ) |
| 78 | .map_err(|e| format!("polars sort failed: {e}")) |
| 79 | } |
| 80 | |
| 81 | fn micros_to_naive(ts_us: i64) -> Option<NaiveDateTime> { |
| 82 | DateTime::<Utc>::from_timestamp_micros(ts_us).map(|dt| dt.naive_utc()) |
no outgoing calls
no test coverage detected