fix(extractor): fallback for any unrecognized impact_horizon value
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user