fix: route macro_news documents as macro_event so global event classification runs

This commit is contained in:
Celes Renata
2026-04-28 16:18:02 +00:00
parent 58613955e4
commit c188677330
+4 -4
View File
@@ -211,15 +211,15 @@ async def persist_broker_event(
def _resolve_document_type(source_type: str) -> str:
"""Map source_type to a document_type value.
Note: macro_news articles default to 'article' the extractor
reclassifies them as 'macro_event' only if the content is truly
about macro/global events (not company-specific news).
Note: macro_news articles are typed as 'macro_event' so the parser
routes them to the macro classification queue for global event
extraction rather than standard company-level extraction.
"""
mapping = {
"news_api": "article",
"filings_api": "filing",
"web_scrape": "press_release",
"macro_news": "article",
"macro_news": "macro_event",
}
return mapping.get(source_type, "article")