(
py: Python<'_>,
timestamps_us: Vec<i64>,
symbols: Vec<String>,
open: Vec<f64>,
high: Vec<f64>,
low: Vec<f64>,
close: Vec<f64>,
volume: Vec<f64>,
adj_close: Vec<f6
| 58 | )) |
| 59 | } |
| 60 | |
| 61 | #[pyfunction(name = "quality_report")] |
| 62 | fn data_quality_report( |
| 63 | py: Python<'_>, |
| 64 | timestamps_us: Vec<i64>, |
| 65 | symbols: Vec<String>, |
| 66 | open: Vec<f64>, |
| 67 | high: Vec<f64>, |
| 68 | low: Vec<f64>, |
| 69 | close: Vec<f64>, |
| 70 | volume: Vec<f64>, |
| 71 | adj_close: Vec<f64>, |
| 72 | ) -> PyResult<PyObject> { |
| 73 | let cols = |
| 74 | build_ohlcv_columns(timestamps_us, symbols, open, high, low, close, volume, adj_close)?; |
| 75 | let report = quality_report_columns(&cols, 0).map_err(to_py_err)?; |
| 76 | let out_report = PyDict::new(py); |
| 77 | out_report.set_item("row_count", report.row_count)?; |
| 78 | out_report.set_item("symbol_count", report.symbol_count)?; |
| 79 | out_report.set_item("duplicate_key_count", report.duplicate_key_count)?; |
| 80 | out_report.set_item("gap_interval_count", report.gap_interval_count)?; |
| 81 | out_report |
| 82 | .set_item("ts_min", report.ts_min.map(|v| v.format("%Y-%m-%d %H:%M:%S").to_string()))?; |
| 83 | out_report |
| 84 | .set_item("ts_max", report.ts_max.map(|v| v.format("%Y-%m-%d %H:%M:%S").to_string()))?; |
| 85 | out_report.set_item("rows_removed_by_deduplication", 0)?; |
| 86 | Ok(out_report.into_pyobject(py).unwrap().into_any().unbind()) |
| 87 | } |
| 88 |
nothing calls this directly
no test coverage detected