fix(sector-radar): 兼容股票市场字段为空

This commit is contained in:
yuxuanhui
2026-08-30 01:50:27 +08:00
parent 6e217ac70f
commit 1e15e8059d
4 changed files with 35 additions and 6 deletions
@@ -315,7 +315,7 @@ def test_stock_basic_explicitly_requests_all_lifecycle_statuses() -> None:
"ts_code": f"00000{index}.SZ",
"symbol": f"00000{index}",
"name": status,
"market": "主板",
"market": None if status == "D" else "主板",
"exchange": "SZSE",
"list_status": status,
"list_date": "20200101",
@@ -329,6 +329,7 @@ def test_stock_basic_explicitly_requests_all_lifecycle_statuses() -> None:
result = make_adapter(client).fetch_stock_basics()
assert {row.list_status for row in result.rows} == {"L", "D", "P", "G", "UN"}
assert next(row for row in result.rows if row.list_status == "D").market is None
assert [call[1]["list_status"] for call in client.calls] == ["L", "D", "P", "G", "UN"]