(symbol_expr: pl.Expr, ts_us_expr: pl.Expr, threshold_seconds: int = 24 * 3600)
| 105 | |
| 106 | |
| 107 | def _gap_expr(symbol_expr: pl.Expr, ts_us_expr: pl.Expr, threshold_seconds: int = 24 * 3600) -> pl.Expr: |
| 108 | threshold_us = int(threshold_seconds) * 1_000_000 |
| 109 | return ( |
| 110 | (symbol_expr == symbol_expr.shift(1)) |
| 111 | & ((ts_us_expr - ts_us_expr.shift(1)) > threshold_us) |
| 112 | ) |
| 113 | |
| 114 | |
| 115 | def _build_quality_report(sorted_df: pl.DataFrame, rows_removed_by_deduplication: int) -> dict[str, Any]: |
no outgoing calls
no test coverage detected