| 70 | def _validate_required_columns(df: pl.DataFrame) -> None: |
| 71 | required = {"ts", "symbol", "open", "high", "low", "close", "volume"} |
| 72 | missing = sorted(required.difference(df.columns)) |
| 73 | if missing: |
| 74 | raise ValueError(f"missing required OHLCV columns: {', '.join(missing)}") |
| 75 | |
| 76 | |
| 77 | # Timestamp strings from the Rust bindings: "%Y-%m-%d %H:%M:%S" with an optional fractional |
| 78 | # second (6 digits, or 9 below a microsecond). polars infers a format from the first value only, so a column |
| 79 | # mixing whole and fractional seconds must be parsed with this explicit format. |