fix: use _global fallback for empty ticker in MinIO storage paths
Macro news documents have no ticker, causing upload_normalized_text and upload_parser_output to produce paths like parsed//2026/... which MinIO rejects as XMinioInvalidObjectName. Use '_global' as the path segment when ticker is empty, matching the existing macro prefix pattern in upload_raw_document.
This commit is contained in:
@@ -221,8 +221,9 @@ def upload_normalized_text(
|
||||
Stores under parsed/{ticker}/{yyyy}/{mm}/{dd}/{document_id}/normalized.txt
|
||||
"""
|
||||
ts = timestamp or datetime.now(timezone.utc)
|
||||
safe_ticker = ticker or "_global"
|
||||
path = (
|
||||
f"parsed/{ticker}/{ts.year}/{ts.month:02d}/{ts.day:02d}/"
|
||||
f"parsed/{safe_ticker}/{ts.year}/{ts.month:02d}/{ts.day:02d}/"
|
||||
f"{document_id}/normalized.txt"
|
||||
)
|
||||
return upload_artifact(
|
||||
@@ -244,8 +245,9 @@ def upload_parser_output(
|
||||
Stores under parsed/{ticker}/{yyyy}/{mm}/{dd}/{document_id}/parser_output.json
|
||||
"""
|
||||
ts = timestamp or datetime.now(timezone.utc)
|
||||
safe_ticker = ticker or "_global"
|
||||
path = (
|
||||
f"parsed/{ticker}/{ts.year}/{ts.month:02d}/{ts.day:02d}/"
|
||||
f"parsed/{safe_ticker}/{ts.year}/{ts.month:02d}/{ts.day:02d}/"
|
||||
f"{document_id}/parser_output.json"
|
||||
)
|
||||
return upload_artifact(
|
||||
|
||||
Reference in New Issue
Block a user