Skip to content

Commit 9f6f74e

Browse files
suan babyclaude
andcommitted
fix: address PR code review issues
1. Remove 现金分红-现金分红比例 from per_share aliases - It is a percentage field (e.g., 30%), not yuan-per-share - Adding it causes 10x inflation in dividend yield calculations 2. Preserve board membership lookup after ranking failures - Only skip belong_boards when boards_coverage is "not_supported" - Keep attempting membership lookup when ranking API returns "failed" - This ensures email sector metrics work even when rankings timeout Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent a86ef02 commit 9f6f74e

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

data_provider/fundamental_adapter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"派息(元/股)",
2828
"税前派息(元/股)",
2929
"现金分红(税前)",
30-
"现金分红-现金分红比例", # Added for stock_fhps_detail_em format
30+
# Note: 现金分红-现金分红比例 is a percentage (e.g., 30%), not yuan-per-share
31+
# Adding it here would cause 10x inflation in dividend yield calculations
3132
],
3233
"plan_text": [
3334
"分配方案",

src/core/pipeline.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -731,16 +731,15 @@ def _attach_belong_boards_to_fundamental_context(
731731
market = get_market_for_stock(normalize_stock_code(code))
732732

733733
# 对于美股和港股,强制尝试获取板块数据(不依赖 boards_status)
734-
# 对于 A 股,使用原有逻辑
734+
# 对于 A 股,只在明确 not_supported 时跳过(failed 应该尝试独立查询)
735735
if market in ("us", "hk"):
736736
# 美股/港股:直接获取板块数据
737737
pass # 继续执行,不跳过
738738
elif (
739739
market not in ("cn", "us", "hk")
740-
or boards_status in ("not_supported", "failed")
741-
or boards_coverage in ("not_supported", "failed")
740+
or boards_coverage in ("not_supported",)
742741
):
743-
# A 股:原有逻辑
742+
# A 股:只有明确 not_supported 时才跳过
744743
enriched_context["belong_boards"] = []
745744
return enriched_context
746745

0 commit comments

Comments
 (0)