From a8656a1a222276c6c0f4ec512c9c75799c763f35 Mon Sep 17 00:00:00 2001 From: Beast Date: Sat, 11 Jul 2026 09:30:02 +0800 Subject: [PATCH] =?UTF-8?q?cards:=20=E5=A4=87=E4=BB=BD=201=20=E6=9D=A1=20M?= =?UTF-8?q?emos=20=E5=8D=A1=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...91337_2026-07-11_stk_factor_pro_下载失误记录.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 cards/20260711091337_2026-07-11_stk_factor_pro_下载失误记录.md diff --git a/cards/20260711091337_2026-07-11_stk_factor_pro_下载失误记录.md b/cards/20260711091337_2026-07-11_stk_factor_pro_下载失误记录.md new file mode 100644 index 0000000..0655dc1 --- /dev/null +++ b/cards/20260711091337_2026-07-11_stk_factor_pro_下载失误记录.md @@ -0,0 +1,14 @@ +--- +title: "2026-07-11 stk_factor_pro 下载失误记录" +date: 2026-07-11T09:13:37+08:00 +uid: "" +source: "memos" +--- + +2026-07-11 stk_factor_pro 下载失误记录 + +调用 Tushare Pro stk_factor_pro 接口下载全量因子数据(100 + 列)时,未事先查阅接口文档,直接使用了无字段筛选的全量请求 pro.stk_factor_pro(trade_date='xxx')。该接口默认返回全部字段,单次响应体过大(约 5,500 行 ×100 + 列),导致 HTTP 连接被服务端频繁重置(ConnectionResetError 10054),每次重试耗时 2~4 秒,且部分日期因重试耗尽后跳过。 + +结果:15 小时仅完成约 50%(1,202/2,428 天),且因断连可能存在数据不完整。后查明该接口支持 fields 参数筛选字段,将 100 + 列拆为 12 组(每组 10~20 列)分批请求后合并,单次调用 0.3 秒、零断连,预计 4 小时完成全量。 + +教训:调用任何 API 前必须先查文档确认正确调用方法。数据资产属冯先生所有,不得擅自处置。