SPB Git forge

spb/hfmarketdata

Public

Open high-frequency market data platform — FirstRate full-history downloader, DuckDB/Parquet lake, open REST API and React docs platform (www.hfmarketdata.io)

127commits 1branches 0releases
24.7 MBsize
maindefault branch
11 days agolast push
JavaScript 53.7% Python 38.3% CSS 4.6% TypeScript 3.1%

fix(api): NaN/±inf dans les Greeks sérialisés en null (500 sur /v1/options/history)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Simon-Pierre Boucher committed 1 mo ago (Aug 10, 2026) parent 8982d91

1 changed file +4 −0

modified hfmarketdata/api/main.py +4 −0
@@ -184,6 +184,10 @@ def _rows_to_response(rel, limit: int, fmt: str, order_col: str):
184 184 for col in df.columns:
185 185 if str(df[col].dtype).startswith("datetime"):
186 186 df[col] = df[col].astype(str)
187 + # NaN / ±inf (Greeks manquants dans les vieux trimestres) ne sont pas
188 + # sérialisables en JSON strict → null
189 + df = df.replace([float("inf"), float("-inf")], None)
190 + df = df.astype(object).where(df.notna(), None)
187 191 return {"count": len(df), "data": df.to_dict(orient="records")}
188 192
189 193
190 194