(interval: str)
| 10 | |
| 11 | |
| 12 | def _interval_to_seconds(interval: str) -> int: |
| 13 | s = interval.strip().lower() |
| 14 | if s.endswith("d"): |
| 15 | return int(s[:-1]) * 24 * 3600 |
| 16 | if s.endswith("h"): |
| 17 | return int(s[:-1]) * 3600 |
| 18 | if s.endswith("m"): |
| 19 | return int(s[:-1]) * 60 |
| 20 | if s.endswith("s"): |
| 21 | return int(s[:-1]) |
| 22 | raise ValueError(f"unsupported interval format: {interval}") |
| 23 | |
| 24 | |
| 25 | def _rows_to_frame(symbol: str, rows: list[tuple[str, str, float, float, float, float, float, float, int]]) -> pl.DataFrame: |