MCPcopy Create free account
hub / github.com/Open-Quant/openquant / _validate_required_columns

Function _validate_required_columns

python/openquant/data.py:72–76  ·  view source on GitHub ↗
(df: pl.DataFrame)

Source from the content-addressed store, hash-verified

70def _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.

Callers 1

_prepare_ohlcv_lfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected