fix(extractor): fallback for any unrecognized impact_horizon value

This commit is contained in:
Celes Renata
2026-04-12 16:27:37 -07:00
parent 6ae8aa779e
commit 4fbddc307a
+3 -3
View File
@@ -268,9 +268,9 @@ def _normalize_extraction_data(data: dict[str, Any]) -> dict[str, Any]:
# Map impact_horizon alternatives
horizon = comp.get("impact_horizon", "")
if isinstance(horizon, str):
mapped = _HORIZON_MAP.get(horizon.lower().strip())
if mapped:
comp["impact_horizon"] = mapped
h = horizon.lower().strip()
if h not in VALID_IMPACT_HORIZONS:
comp["impact_horizon"] = _HORIZON_MAP.get(h, "1d_30d")
# Map catalyst_type alternatives
cat = comp.get("catalyst_type", "")
if isinstance(cat, str) and cat.lower().strip() not in _VALID_CATALYSTS: