vn.py量化社区
By Traders, For Traders.
Member
avatar
加入于:
帖子: 2
声望: 0

Exception in thread Thread-9:
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\peewee.py", line 2949, in execute_sql
cursor.execute(sql, params or ())
File "C:\Anaconda3\lib\site-packages\pymysql\cursors.py", line 170, in execute
result = self._query(query)
File "C:\Anaconda3\lib\site-packages\pymysql\cursors.py", line 328, in _query
conn.query(q)
File "C:\Anaconda3\lib\site-packages\pymysql\connections.py", line 517, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "C:\Anaconda3\lib\site-packages\pymysql\connections.py", line 732, in _read_query_result
result.read()
File "C:\Anaconda3\lib\site-packages\pymysql\connections.py", line 1075, in read
first_packet = self.connection._read_packet()
File "C:\Anaconda3\lib\site-packages\pymysql\connections.py", line 684, in _read_packet
packet.check_error()
File "C:\Anaconda3\lib\site-packages\pymysql\protocol.py", line 220, in check_error
err.raise_mysql_exception(self._data)
File "C:\Anaconda3\lib\site-packages\pymysql\err.py", line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.InternalError: (1367, "Illegal double '1.79769313486232e+308' value found during parsing")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Anaconda3\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "C:\Anaconda3\lib\threading.py", line 865, in run
self._target(self._args, **self._kwargs)
File "C:\workspace\vnpy-2.0.4\vnpy\app\data_recorder\engine.py", line 76, in run
database_manager.save_tick_data([data])
File "C:\workspace\vnpy-2.0.4\vnpy\trader\database\database_sql.py", line 378, in save_tick_data
self.class_tick.save_all(ds)
File "C:\workspace\vnpy-2.0.4\vnpy\trader\database\database_sql.py", line 320, in save_all
DbTickData.insert_many(c).on_conflict_replace().execute()
File "C:\Anaconda3\lib\site-packages\peewee.py", line 1785, in inner
return method(self, database,
args, *kwargs)
File "C:\Anaconda3\lib\site-packages\peewee.py", line 1856, in execute
return self._execute(database)
File "C:\Anaconda3\lib\site-packages\peewee.py", line 2572, in _execute
return super(Insert, self)._execute(database)
File "C:\Anaconda3\lib\site-packages\peewee.py", line 2320, in _execute
cursor = database.execute(self)
File "C:\Anaconda3\lib\site-packages\peewee.py", line 2962, in execute
return self.execute_sql(sql, params, commit=commit)
File "C:\Anaconda3\lib\site-packages\peewee.py", line 2956, in execute_sql
self.commit()
File "C:\Anaconda3\lib\site-packages\peewee.py", line 2732, in exit
reraise(new_type, new_type(
exc_args), traceback)
File "C:\Anaconda3\lib\site-packages\peewee.py", line 183, in reraise
raise value.with_traceback(tb)
File "C:\Anaconda3\lib\site-packages\peewee.py", line 2949, in execute_sql
cursor.execute(sql, params or ())
File "C:\Anaconda3\lib\site-packages\pymysql\cursors.py", line 170, in execute
result = self._query(query)
File "C:\Anaconda3\lib\site-packages\pymysql\cursors.py", line 328, in _query
conn.query(q)
File "C:\Anaconda3\lib\site-packages\pymysql\connections.py", line 517, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "C:\Anaconda3\lib\site-packages\pymysql\connections.py", line 732, in _read_query_result
result.read()
File "C:\Anaconda3\lib\site-packages\pymysql\connections.py", line 1075, in read
first_packet = self.connection._read_packet()
File "C:\Anaconda3\lib\site-packages\pymysql\connections.py", line 684, in _read_packet
packet.check_error()
File "C:\Anaconda3\lib\site-packages\pymysql\protocol.py", line 220, in check_error
err.raise_mysql_exception(self._data)
File "C:\Anaconda3\lib\site-packages\pymysql\err.py", line 109, in raise_mysql_exception
raise errorclass(errno, errval)
peewee.InternalError: (1367, "Illegal double '1.79769313486232e+308' value found during parsing")

Administrator
avatar
加入于:
帖子: 1919
声望: 87

这个是数据溢出导致的,具体是什么接口?记录了什么行情呢

Member
avatar
加入于:
帖子: 3
声望: 0

同样遇到了这个问题,行情记录引擎RecorderEngine,save_tick_data方法保存数据到mysql的时候,数据推送是1.7976931348623157e+308科学计数法,所以报错

Member
avatar
加入于:
帖子: 2
声望: 0

用Python的交易员 wrote:

这个是数据溢出导致的,具体是什么接口?记录了什么行情呢

1.接口 database_manager.save_tick_data([data])

  1. 数据库使用mysql
  2. 行情记录有rb1910.SHFE,IF1907.CFFEX,IF1909.CFFEX
Administrator
avatar
加入于:
帖子: 1919
声望: 87

这个确实是浮点数溢出导致的了,请在Github开个issue吧,我们来排查下

© 2015-2019 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3