From 4fbddc307a9ebe55a9a4240f711cc0548667a04f Mon Sep 17 00:00:00 2001 From: Celes Renata Date: Sun, 12 Apr 2026 16:27:37 -0700 Subject: [PATCH] fix(extractor): fallback for any unrecognized impact_horizon value --- services/extractor/schemas.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/extractor/schemas.py b/services/extractor/schemas.py index 8319842..02199df 100644 --- a/services/extractor/schemas.py +++ b/services/extractor/schemas.py @@ -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: