420813a690
- 实现核心数据适配器(akshare_vnpy_adapter.py) * 数据库初始化(vn.py DbBarData表) * 股票列表获取(全市场A股) * 单只/全市场K线数据下载 * akshare→vn.py格式自动转换 * 批量插入优化(executemany) * 数据完整性验证 - 实现批量下载器(batch_downloader.py) * 断点续传支持(JSON进度文件) * 失败重试机制 * 进度实时保存 * 测试模式支持 - 实现测试脚本(test_adapter.py) * 单元测试覆盖所有核心功能 * 完整流程验证 - 完善文档 * README.md - 完整使用文档 * IMPLEMENTATION_REPORT.md - 实施详情报告 * VALIDATION_REPORT.md - 验证报告 * VALIDATION_REPORT_TEMPLATE.md - 验证报告模板 作者: 赵云(数据护军) 日期: 2026-03-24
100 lines
6.5 KiB
Plaintext
100 lines
6.5 KiB
Plaintext
2026-03-24 12:37:15,155 - akshare_vnpy_adapter - INFO - 创建数据库目录: /Users/chufeng/.openclaw/workspace-pangtong/sanguo_quant_live/running_data
|
|
2026-03-24 12:37:15,156 - __main__ - INFO - ============================================================
|
|
2026-03-24 12:37:15,156 - __main__ - INFO - 开始测试 akshare → vn.py 数据适配器
|
|
2026-03-24 12:37:15,156 - __main__ - INFO - ============================================================
|
|
2026-03-24 12:37:15,156 - __main__ - INFO -
|
|
[测试1] 初始化数据库表结构...
|
|
2026-03-24 12:37:15,158 - akshare_vnpy_adapter - INFO - 数据库表结构初始化完成
|
|
2026-03-24 12:37:15,158 - __main__ - INFO - ✓ 数据库初始化成功
|
|
2026-03-24 12:37:15,158 - __main__ - INFO -
|
|
[测试2] 获取股票列表...
|
|
2026-03-24 12:37:23,812 - akshare_vnpy_adapter - ERROR - 获取股票列表失败: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
|
|
2026-03-24 12:37:23,812 - __main__ - ERROR - 测试失败: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
|
|
Traceback (most recent call last):
|
|
File "/Users/chufeng/Library/Python/3.14/lib/python/site-packages/urllib3/connectionpool.py", line 787, in urlopen
|
|
response = self._make_request(
|
|
conn,
|
|
...<10 lines>...
|
|
**response_kw,
|
|
)
|
|
File "/Users/chufeng/Library/Python/3.14/lib/python/site-packages/urllib3/connectionpool.py", line 534, in _make_request
|
|
response = conn.getresponse()
|
|
File "/Users/chufeng/Library/Python/3.14/lib/python/site-packages/urllib3/connection.py", line 571, in getresponse
|
|
httplib_response = super().getresponse()
|
|
File "/opt/homebrew/Cellar/python@3.14/3.14.3_1/Frameworks/Python.framework/Versions/3.14/lib/python3.14/http/client.py", line 1450, in getresponse
|
|
response.begin()
|
|
~~~~~~~~~~~~~~^^
|
|
File "/opt/homebrew/Cellar/python@3.14/3.14.3_1/Frameworks/Python.framework/Versions/3.14/lib/python3.14/http/client.py", line 336, in begin
|
|
version, status, reason = self._read_status()
|
|
~~~~~~~~~~~~~~~~~^^
|
|
File "/opt/homebrew/Cellar/python@3.14/3.14.3_1/Frameworks/Python.framework/Versions/3.14/lib/python3.14/http/client.py", line 305, in _read_status
|
|
raise RemoteDisconnected("Remote end closed connection without"
|
|
" response")
|
|
http.client.RemoteDisconnected: Remote end closed connection without response
|
|
|
|
During handling of the above exception, another exception occurred:
|
|
|
|
Traceback (most recent call last):
|
|
File "/Users/chufeng/Library/Python/3.14/lib/python/site-packages/requests/adapters.py", line 644, in send
|
|
resp = conn.urlopen(
|
|
method=request.method,
|
|
...<9 lines>...
|
|
chunked=chunked,
|
|
)
|
|
File "/Users/chufeng/Library/Python/3.14/lib/python/site-packages/urllib3/connectionpool.py", line 841, in urlopen
|
|
retries = retries.increment(
|
|
method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]
|
|
)
|
|
File "/Users/chufeng/Library/Python/3.14/lib/python/site-packages/urllib3/util/retry.py", line 490, in increment
|
|
raise reraise(type(error), error, _stacktrace)
|
|
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
File "/Users/chufeng/Library/Python/3.14/lib/python/site-packages/urllib3/util/util.py", line 38, in reraise
|
|
raise value.with_traceback(tb)
|
|
File "/Users/chufeng/Library/Python/3.14/lib/python/site-packages/urllib3/connectionpool.py", line 787, in urlopen
|
|
response = self._make_request(
|
|
conn,
|
|
...<10 lines>...
|
|
**response_kw,
|
|
)
|
|
File "/Users/chufeng/Library/Python/3.14/lib/python/site-packages/urllib3/connectionpool.py", line 534, in _make_request
|
|
response = conn.getresponse()
|
|
File "/Users/chufeng/Library/Python/3.14/lib/python/site-packages/urllib3/connection.py", line 571, in getresponse
|
|
httplib_response = super().getresponse()
|
|
File "/opt/homebrew/Cellar/python@3.14/3.14.3_1/Frameworks/Python.framework/Versions/3.14/lib/python3.14/http/client.py", line 1450, in getresponse
|
|
response.begin()
|
|
~~~~~~~~~~~~~~^^
|
|
File "/opt/homebrew/Cellar/python@3.14/3.14.3_1/Frameworks/Python.framework/Versions/3.14/lib/python3.14/http/client.py", line 336, in begin
|
|
version, status, reason = self._read_status()
|
|
~~~~~~~~~~~~~~~~~^^
|
|
File "/opt/homebrew/Cellar/python@3.14/3.14.3_1/Frameworks/Python.framework/Versions/3.14/lib/python3.14/http/client.py", line 305, in _read_status
|
|
raise RemoteDisconnected("Remote end closed connection without"
|
|
" response")
|
|
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
|
|
|
|
During handling of the above exception, another exception occurred:
|
|
|
|
Traceback (most recent call last):
|
|
File "/Users/chufeng/.openclaw/workspace-pangtong/sanguo_quant_live/data-engineering/test_adapter.py", line 46, in test_adapter
|
|
stock_list = adapter.get_stock_list()
|
|
File "/Users/chufeng/.openclaw/workspace-pangtong/sanguo_quant_live/data-engineering/akshare_vnpy_adapter.py", line 135, in get_stock_list
|
|
stock_list = ak.stock_zh_a_spot_em()
|
|
File "/opt/homebrew/lib/python3.14/site-packages/akshare/stock_feature/stock_hist_em.py", line 36, in stock_zh_a_spot_em
|
|
temp_df = fetch_paginated_data(url, params)
|
|
File "/opt/homebrew/lib/python3.14/site-packages/akshare/utils/func.py", line 50, in fetch_paginated_data
|
|
r = request_with_retry(url, params=params, timeout=timeout)
|
|
File "/opt/homebrew/lib/python3.14/site-packages/akshare/utils/request.py", line 64, in request_with_retry
|
|
raise last_exception
|
|
File "/opt/homebrew/lib/python3.14/site-packages/akshare/utils/request.py", line 52, in request_with_retry
|
|
response = session.get(url, params=params, timeout=timeout)
|
|
File "/Users/chufeng/Library/Python/3.14/lib/python/site-packages/requests/sessions.py", line 602, in get
|
|
return self.request("GET", url, **kwargs)
|
|
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
|
|
File "/Users/chufeng/Library/Python/3.14/lib/python/site-packages/requests/sessions.py", line 589, in request
|
|
resp = self.send(prep, **send_kwargs)
|
|
File "/Users/chufeng/Library/Python/3.14/lib/python/site-packages/requests/sessions.py", line 703, in send
|
|
r = adapter.send(request, **kwargs)
|
|
File "/Users/chufeng/Library/Python/3.14/lib/python/site-packages/requests/adapters.py", line 659, in send
|
|
raise ConnectionError(err, request=request)
|
|
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
|
|
2026-03-24 12:37:23,828 - akshare_vnpy_adapter - INFO - 数据库连接已关闭
|