(
df: pl.DataFrame,
*,
interval: str = "1d",
)
| 247 | "null_counts": dict(null_counts), |
| 248 | } |
| 249 | |
| 250 | |
| 251 | def _interval_to_seconds(interval: str) -> int: |
| 252 | s = interval.strip().lower() |
| 253 | if s.endswith("d"): |
| 254 | return int(s[:-1]) * 24 * 3600 |
| 255 | if s.endswith("h"): |
| 256 | return int(s[:-1]) * 3600 |
| 257 | if s.endswith("m"): |
| 258 | return int(s[:-1]) * 60 |
| 259 | if s.endswith("s"): |
| 260 | return int(s[:-1]) |
| 261 | raise ValueError(f"unsupported interval format: {interval}") |
| 262 | |
| 263 | |
| 264 | @overload |
| 265 | def clean_ohlcv( |
| 266 | df: pl.DataFrame, |
| 267 | *, |
| 268 | dedupe_keep: Literal["first", "last"] = ..., |
| 269 | return_report: Literal[False] = ..., |
| 270 | ) -> pl.DataFrame: ... |
| 271 | |
| 272 | |
| 273 | @overload |
| 274 | def clean_ohlcv( |
| 275 | df: pl.DataFrame, |
| 276 | *, |
| 277 | dedupe_keep: Literal["first", "last"] = ..., |
| 278 | return_report: Literal[True], |
| 279 | ) -> tuple[pl.DataFrame, dict[str, Any]]: ... |
| 280 | |
| 281 | |
| 282 | @overload |
| 283 | def clean_ohlcv( |
| 284 | df: pl.DataFrame, |
| 285 | *, |
| 286 | dedupe_keep: Literal["first", "last"] = ..., |
nothing calls this directly
no test coverage detected