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

Function _digest_frame

python/tests/test_data_module.py:16–19  ·  view source on GitHub ↗
(df: pl.DataFrame)

Source from the content-addressed store, hash-verified

14
15
16def _digest_frame(df: pl.DataFrame) -> str:
17 normalized = df.with_columns(pl.col("ts").dt.strftime("%Y-%m-%d %H:%M:%S"))
18 payload = json.dumps(normalized.to_dict(as_series=False), sort_keys=True, separators=(",", ":"))
19 return hashlib.sha256(payload.encode("utf-8")).hexdigest()
20
21
22def test_load_ohlcv_enforces_canonical_schema_and_determinism():

Calls

no outgoing calls

Tested by

no test coverage detected