Merge origin/main into codex/roadmap-publish
This commit is contained in:
@@ -297,8 +297,21 @@ def _collect_one(row: dict[str, Any], *, kis_account: str, include_naver: bool,
|
||||
if key in naver:
|
||||
normalized.setdefault(key, naver.get(key))
|
||||
normalized.setdefault("naver_price_status", naver.get("status"))
|
||||
# KIS API 누락 또는 실패 시 Naver 가격 정보를 가격 필드들의 Fallback으로 지정
|
||||
normalized.setdefault("current_price", naver.get("close"))
|
||||
normalized.setdefault("open", naver.get("open"))
|
||||
normalized.setdefault("high", naver.get("high"))
|
||||
normalized.setdefault("low", naver.get("low"))
|
||||
normalized.setdefault("volume", naver.get("volume"))
|
||||
provenance["source_priority"].append("naver_finance")
|
||||
|
||||
# KIS 및 Naver 가격 정보가 모두 없을 시, GatherTradingData.json 원본 시드 가격을 최후의 수단으로 복원
|
||||
normalized.setdefault("current_price", _coerce_float(row.get("current_price") or row.get("Current_Price") or row.get("close")))
|
||||
normalized.setdefault("open", _coerce_float(row.get("open") or row.get("Open")))
|
||||
normalized.setdefault("high", _coerce_float(row.get("high") or row.get("High")))
|
||||
normalized.setdefault("low", _coerce_float(row.get("low") or row.get("Low")))
|
||||
normalized.setdefault("volume", _coerce_float(row.get("volume") or row.get("Volume")))
|
||||
|
||||
normalized.setdefault("collection_as_of", _kst_now_iso())
|
||||
return normalized, provenance
|
||||
|
||||
|
||||
Reference in New Issue
Block a user