=========================================================================
2025-08-13 16:25:35 Wed START TASK.01 future_1d future_rank
=========================================================================
2025-08-13 16:25:37,332 - future_1d - INFO - future_rank check=True check_last=7 start...
2025-08-13 16:25:37,417 - future_1d - INFO - future_rank date = 2025-08-05
2025-08-13 16:25:37,556 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='GFEX) done
2025-08-13 16:25:37,659 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='CFFEX) done
2025-08-13 16:25:37,812 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='DCE) done
2025-08-13 16:25:37,984 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='SHFE) done
2025-08-13 16:25:38,061 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='INE) done
2025-08-13 16:25:38,258 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='CZCE) done
2025-08-13 16:25:38,942 - future_1d - INFO - save future_rank 2025-08-05 completed
2025-08-13 16:25:48,585 - future_1d - INFO - future_rank date = 2025-08-06
2025-08-13 16:25:48,699 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='GFEX) done
2025-08-13 16:25:48,835 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='CFFEX) done
2025-08-13 16:25:48,989 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='DCE) done
2025-08-13 16:25:49,162 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='SHFE) done
2025-08-13 16:25:49,227 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='INE) done
2025-08-13 16:25:49,491 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='CZCE) done
2025-08-13 16:25:50,193 - future_1d - INFO - save future_rank 2025-08-06 completed
2025-08-13 16:25:56,039 - future_1d - INFO - future_rank date = 2025-08-07
2025-08-13 16:25:56,136 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='GFEX) done
2025-08-13 16:25:56,289 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='CFFEX) done
2025-08-13 16:25:56,460 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='DCE) done
2025-08-13 16:25:56,615 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='SHFE) done
2025-08-13 16:25:56,707 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='INE) done
2025-08-13 16:25:56,903 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='CZCE) done
2025-08-13 16:25:57,559 - future_1d - INFO - save future_rank 2025-08-07 completed
2025-08-13 16:26:06,669 - future_1d - INFO - future_rank date = 2025-08-08
2025-08-13 16:26:06,790 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='GFEX) done
2025-08-13 16:26:06,890 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='CFFEX) done
2025-08-13 16:26:07,048 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='DCE) done
2025-08-13 16:26:07,221 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='SHFE) done
2025-08-13 16:26:07,280 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='INE) done
2025-08-13 16:26:07,466 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='CZCE) done
2025-08-13 16:26:08,201 - future_1d - INFO - save future_rank 2025-08-08 completed
2025-08-13 16:26:18,021 - future_1d - INFO - future_rank date = 2025-08-11
2025-08-13 16:26:18,152 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='GFEX) done
2025-08-13 16:26:18,261 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='CFFEX) done
2025-08-13 16:26:18,358 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='DCE) done
2025-08-13 16:26:18,505 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='SHFE) done
2025-08-13 16:26:18,567 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='INE) done
2025-08-13 16:26:18,757 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='CZCE) done
2025-08-13 16:26:19,437 - future_1d - INFO - save future_rank 2025-08-11 completed
2025-08-13 16:26:27,625 - future_1d - INFO - future_rank date = 2025-08-12
2025-08-13 16:26:27,742 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='GFEX) done
2025-08-13 16:26:27,859 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='CFFEX) done
2025-08-13 16:26:27,948 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='DCE) done
2025-08-13 16:26:28,092 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='SHFE) done
2025-08-13 16:26:28,183 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='INE) done
2025-08-13 16:26:28,374 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='CZCE) done
2025-08-13 16:26:29,051 - future_1d - INFO - save future_rank 2025-08-12 add
2025-08-13 16:26:29,060 - future_1d - INFO - 0 ... 4
date 2025-08-12 ... 2025-08-12
symbol si2509 ... si2509
broker 中信期货 ... 一德期货
vol 10686.0 ... 6967.0
vol_chg -3474.0 ... 6565.0
long_hld 1888.0 ... 1253.0
long_chg 10.0 ... -3358.0
short_hld 1671.0 ... NaN
short_chg -246.0 ... NaN
exchange GFEX ... GFEX
variety si ... si
comd si ... si
created_at 2025-08-13 16:26:28.960855 ... 2025-08-13 16:26:28.960855
updated_at 2025-08-13 16:26:28.961308 ... 2025-08-13 16:26:28.961308
[14 rows x 5 columns]
2025-08-13 16:26:36,120 - future_1d - INFO - future_rank date = 2025-08-13
2025-08-13 16:26:36,182 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='GFEX) done
2025-08-13 16:26:36,257 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='CFFEX) done
2025-08-13 16:26:36,335 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='DCE) done
2025-08-13 16:26:36,415 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='SHFE) done
2025-08-13 16:26:36,478 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='INE) done
2025-08-13 16:26:36,539 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='CZCE) done
2025-08-13 16:26:36,555 - future_1d - INFO - save future_rank 2025-08-13 failed
=========================================================================
2025-08-13 18:25:33 Wed START TASK.01 future_1d future_rank
=========================================================================
2025-08-13 18:25:35,725 - future_1d - INFO - future_rank check=True check_last=7 start...
2025-08-13 18:25:35,807 - future_1d - INFO - future_rank date = 2025-08-05
2025-08-13 18:25:36,003 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='SHFE) done
2025-08-13 18:25:36,096 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='GFEX) done
2025-08-13 18:25:36,257 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='DCE) done
2025-08-13 18:25:36,364 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='CFFEX) done
2025-08-13 18:25:36,733 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='CZCE) done
2025-08-13 18:25:36,807 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='INE) done
2025-08-13 18:25:37,503 - future_1d - INFO - save future_rank 2025-08-05 completed
2025-08-13 18:25:47,053 - future_1d - INFO - future_rank date = 2025-08-06
2025-08-13 18:25:47,222 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='SHFE) done
2025-08-13 18:25:47,331 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='GFEX) done
2025-08-13 18:25:47,586 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='DCE) done
2025-08-13 18:25:47,719 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='CFFEX) done
2025-08-13 18:25:47,919 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='CZCE) done
2025-08-13 18:25:48,027 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='INE) done
2025-08-13 18:25:48,738 - future_1d - INFO - save future_rank 2025-08-06 completed
2025-08-13 18:25:55,875 - future_1d - INFO - future_rank date = 2025-08-07
2025-08-13 18:25:56,077 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='SHFE) done
2025-08-13 18:25:56,242 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='GFEX) done
2025-08-13 18:25:56,416 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='DCE) done
2025-08-13 18:25:56,514 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='CFFEX) done
2025-08-13 18:25:56,727 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='CZCE) done
2025-08-13 18:25:56,787 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='INE) done
2025-08-13 18:25:57,450 - future_1d - INFO - save future_rank 2025-08-07 completed
2025-08-13 18:26:02,115 - future_1d - INFO - future_rank date = 2025-08-08
2025-08-13 18:26:02,279 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='SHFE) done
2025-08-13 18:26:02,442 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='GFEX) done
2025-08-13 18:26:02,714 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='DCE) done
2025-08-13 18:26:02,895 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='CFFEX) done
2025-08-13 18:26:03,306 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='CZCE) done
2025-08-13 18:26:03,390 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='INE) done
2025-08-13 18:26:04,115 - future_1d - INFO - save future_rank 2025-08-08 completed
2025-08-13 18:26:11,397 - future_1d - INFO - future_rank date = 2025-08-11
2025-08-13 18:26:11,562 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='SHFE) done
2025-08-13 18:26:11,653 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='GFEX) done
2025-08-13 18:26:11,753 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='DCE) done
2025-08-13 18:26:11,857 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='CFFEX) done
2025-08-13 18:26:12,076 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='CZCE) done
2025-08-13 18:26:12,138 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='INE) done
2025-08-13 18:26:12,684 - future_1d - INFO - save future_rank 2025-08-11 completed
2025-08-13 18:26:16,668 - future_1d - INFO - future_rank date = 2025-08-12
2025-08-13 18:26:16,871 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='SHFE) done
2025-08-13 18:26:16,991 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='GFEX) done
2025-08-13 18:26:17,071 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='DCE) done
2025-08-13 18:26:17,190 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='CFFEX) done
2025-08-13 18:26:17,550 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='CZCE) done
2025-08-13 18:26:17,631 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='INE) done
2025-08-13 18:26:18,168 - future_1d - INFO - save future_rank 2025-08-12 completed
2025-08-13 18:26:23,688 - future_1d - INFO - future_rank date = 2025-08-13
2025-08-13 18:26:24,023 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='SHFE) done
2025-08-13 18:26:24,116 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='GFEX) done
2025-08-13 18:26:24,222 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='DCE) done
2025-08-13 18:26:24,366 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='CFFEX) done
2025-08-13 18:26:24,701 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='CZCE) done
2025-08-13 18:26:24,763 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='INE) done
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1936, in _exec_single_context
self.dialect.do_executemany(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 196, in do_executemany
rowcount = cursor.executemany(statement, parameters)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 187, in executemany
return self._do_execute_many(
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 225, in _do_execute_many
rows += self.execute(sql + postfix)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
result = self._query(query)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
conn.query(q)
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
result.read()
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
first_packet = self.connection._read_packet()
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 729, in _read_packet
packet.raise_for_error()
File "/usr/local/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.DataError: (1406, "Data too long for column 'broker' at row 1")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/project/future_1d/future_rank.py", line 8, in
client.save_future_rank(check=True, check_last=7)
File "/root/project/future_1d/future1d_request.py", line 976, in save_future_rank
data_add.to_sql(tablebase.__tablename__, self.engine, index=False, if_exists='append', chunksize=1000)
File "/usr/local/lib/python3.10/site-packages/pandas/util/_decorators.py", line 333, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/pandas/core/generic.py", line 3106, in to_sql
return sql.to_sql(
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 844, in to_sql
return pandas_sql.to_sql(
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 2030, in to_sql
total_inserted = sql_engine.insert_records(
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1579, in insert_records
raise err
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1570, in insert_records
return table.insert(chunksize=chunksize, method=method)
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1121, in insert
num_inserted = exec_insert(conn, keys, chunk_iter)
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1012, in _execute_insert
result = conn.execute(self.table.insert(), data)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1419, in execute
return meth(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/sql/elements.py", line 526, in _execute_on_connection
return connection._execute_clauseelement(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1641, in _execute_clauseelement
ret = self._execute_context(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
return self._exec_single_context(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
self._handle_dbapi_exception(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1936, in _exec_single_context
self.dialect.do_executemany(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 196, in do_executemany
rowcount = cursor.executemany(statement, parameters)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 187, in executemany
return self._do_execute_many(
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 225, in _do_execute_many
rows += self.execute(sql + postfix)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
result = self._query(query)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
conn.query(q)
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
result.read()
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
first_packet = self.connection._read_packet()
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 729, in _read_packet
packet.raise_for_error()
File "/usr/local/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
sqlalchemy.exc.DataError: (pymysql.err.DataError) (1406, "Data too long for column 'broker' at row 1")
[SQL: INSERT INTO future_rank (date, symbol, broker, vol, vol_chg, long_hld, long_chg, short_hld, short_chg, exchange, variety, comd, created_at, updated_at) VALUES (%(date)s, %(symbol)s, %(broker)s, %(vol)s, %(vol_chg)s, %(long_hld)s, %(long_chg)s, %(short_hld)s, %(short_chg)s, %(exchange)s, %(variety)s, %(comd)s, %(created_at)s, %(updated_at)s)]
[parameters: [{'date': '2025-08-13', 'symbol': 'AD', 'broker': '期货公司会员/境外特殊经纪参与者', 'vol': 4696.0, 'vol_chg': 2504.0, 'long_hld': 10202.0, 'long_chg': 34.0, 'short_hld': 10202.0, 'short_chg': 34.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 869591), 'updated_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 870016)}, {'date': '2025-08-13', 'symbol': 'AD', 'broker': '非期货公司会员/境外特殊非经纪参与者', 'vol': 0.0, 'vol_chg': 0.0, 'long_hld': 0.0, 'long_chg': 0.0, 'short_hld': 0.0, 'short_chg': 0.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 869591), 'updated_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 870016)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '东亚期货', 'vol': None, 'vol_chg': None, 'long_hld': 148.0, 'long_chg': 3.0, 'short_hld': None, 'short_chg': None, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 869591), 'updated_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 870016)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '东吴期货', 'vol': 86.0, 'vol_chg': 40.0, 'long_hld': None, 'long_chg': None, 'short_hld': 191.0, 'short_chg': 22.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 869591), 'updated_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 870016)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '东海期货', 'vol': 151.0, 'vol_chg': 89.0, 'long_hld': 225.0, 'long_chg': 25.0, 'short_hld': None, 'short_chg': None, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 869591), 'updated_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 870016)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '东证期货', 'vol': 138.0, 'vol_chg': 77.0, 'long_hld': 841.0, 'long_chg': -40.0, 'short_hld': 583.0, 'short_chg': -2.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 869591), 'updated_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 870016)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '中信建投', 'vol': 237.0, 'vol_chg': 217.0, 'long_hld': None, 'long_chg': None, 'short_hld': 252.0, 'short_chg': -197.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 869591), 'updated_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 870016)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '中信期货', 'vol': 265.0, 'vol_chg': 143.0, 'long_hld': 761.0, 'long_chg': -7.0, 'short_hld': 656.0, 'short_chg': -4.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 869591), 'updated_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 870016)} ... displaying 10 of 1000 total bound parameter sets ... {'date': '2025-08-13', 'symbol': 'CU2508', 'broker': '五矿期货', 'vol': 1340.0, 'vol_chg': 165.0, 'long_hld': None, 'long_chg': None, 'short_hld': 1335.0, 'short_chg': -910.0, 'exchange': 'SHFE', 'variety': 'CU', 'comd': 'cu', 'created_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 869591), 'updated_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 870016)}, {'date': '2025-08-13', 'symbol': 'CU2508', 'broker': '光大期货', 'vol': 870.0, 'vol_chg': 200.0, 'long_hld': 180.0, 'long_chg': -235.0, 'short_hld': 320.0, 'short_chg': -255.0, 'exchange': 'SHFE', 'variety': 'CU', 'comd': 'cu', 'created_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 869591), 'updated_at': datetime.datetime(2025, 8, 13, 18, 26, 24, 870016)}]]
(Background on this error at: https://sqlalche.me/e/20/9h9h)
=========================================================================
2025-08-13 18:27:08 Wed START TASK.01 future_1d future_rank
=========================================================================
2025-08-13 18:27:10,856 - future_1d - INFO - future_rank check=True check_last=7 start...
2025-08-13 18:27:10,941 - future_1d - INFO - future_rank date = 2025-08-05
2025-08-13 18:27:11,115 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='DCE) done
2025-08-13 18:27:11,207 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='GFEX) done
2025-08-13 18:27:11,401 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='SHFE) done
2025-08-13 18:27:11,605 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='CZCE) done
2025-08-13 18:27:11,699 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='CFFEX) done
2025-08-13 18:27:11,763 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='INE) done
2025-08-13 18:27:12,468 - future_1d - INFO - save future_rank 2025-08-05 completed
2025-08-13 18:27:20,973 - future_1d - INFO - future_rank date = 2025-08-06
2025-08-13 18:27:21,151 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='DCE) done
2025-08-13 18:27:21,250 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='GFEX) done
2025-08-13 18:27:21,408 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='SHFE) done
2025-08-13 18:27:21,684 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='CZCE) done
2025-08-13 18:27:21,881 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='CFFEX) done
2025-08-13 18:27:22,016 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='INE) done
2025-08-13 18:27:22,734 - future_1d - INFO - save future_rank 2025-08-06 completed
2025-08-13 18:27:31,032 - future_1d - INFO - future_rank date = 2025-08-07
2025-08-13 18:27:31,208 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='DCE) done
2025-08-13 18:27:31,300 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='GFEX) done
2025-08-13 18:27:31,510 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='SHFE) done
2025-08-13 18:27:31,706 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='CZCE) done
2025-08-13 18:27:31,827 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='CFFEX) done
2025-08-13 18:27:31,905 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='INE) done
2025-08-13 18:27:32,583 - future_1d - INFO - save future_rank 2025-08-07 completed
2025-08-13 18:27:36,227 - future_1d - INFO - future_rank date = 2025-08-08
2025-08-13 18:27:36,388 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='DCE) done
2025-08-13 18:27:36,493 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='GFEX) done
2025-08-13 18:27:36,677 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='SHFE) done
2025-08-13 18:27:36,868 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='CZCE) done
2025-08-13 18:27:36,985 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='CFFEX) done
2025-08-13 18:27:37,050 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='INE) done
2025-08-13 18:27:37,791 - future_1d - INFO - save future_rank 2025-08-08 completed
2025-08-13 18:27:46,017 - future_1d - INFO - future_rank date = 2025-08-11
2025-08-13 18:27:46,109 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='DCE) done
2025-08-13 18:27:46,219 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='GFEX) done
2025-08-13 18:27:46,361 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='SHFE) done
2025-08-13 18:27:46,581 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='CZCE) done
2025-08-13 18:27:46,762 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='CFFEX) done
2025-08-13 18:27:46,840 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='INE) done
2025-08-13 18:27:47,365 - future_1d - INFO - save future_rank 2025-08-11 completed
2025-08-13 18:27:56,494 - future_1d - INFO - future_rank date = 2025-08-12
2025-08-13 18:27:56,576 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='DCE) done
2025-08-13 18:27:56,678 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='GFEX) done
2025-08-13 18:27:56,849 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='SHFE) done
2025-08-13 18:27:57,056 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='CZCE) done
2025-08-13 18:27:57,151 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='CFFEX) done
2025-08-13 18:27:57,229 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='INE) done
2025-08-13 18:27:57,759 - future_1d - INFO - save future_rank 2025-08-12 completed
2025-08-13 18:28:05,886 - future_1d - INFO - future_rank date = 2025-08-13
2025-08-13 18:28:05,973 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='DCE) done
2025-08-13 18:28:06,060 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='GFEX) done
2025-08-13 18:28:06,209 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='SHFE) done
2025-08-13 18:28:06,407 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='CZCE) done
2025-08-13 18:28:06,499 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='CFFEX) done
2025-08-13 18:28:06,563 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='INE) done
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1936, in _exec_single_context
self.dialect.do_executemany(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 196, in do_executemany
rowcount = cursor.executemany(statement, parameters)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 187, in executemany
return self._do_execute_many(
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 225, in _do_execute_many
rows += self.execute(sql + postfix)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
result = self._query(query)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
conn.query(q)
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
result.read()
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
first_packet = self.connection._read_packet()
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 729, in _read_packet
packet.raise_for_error()
File "/usr/local/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.DataError: (1406, "Data too long for column 'broker' at row 1")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/project/future_1d/future_rank.py", line 8, in
client.save_future_rank(check=True, check_last=7)
File "/root/project/future_1d/future1d_request.py", line 976, in save_future_rank
data_add.to_sql(tablebase.__tablename__, self.engine, index=False, if_exists='append', chunksize=1000)
File "/usr/local/lib/python3.10/site-packages/pandas/util/_decorators.py", line 333, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/pandas/core/generic.py", line 3106, in to_sql
return sql.to_sql(
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 844, in to_sql
return pandas_sql.to_sql(
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 2030, in to_sql
total_inserted = sql_engine.insert_records(
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1579, in insert_records
raise err
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1570, in insert_records
return table.insert(chunksize=chunksize, method=method)
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1121, in insert
num_inserted = exec_insert(conn, keys, chunk_iter)
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1012, in _execute_insert
result = conn.execute(self.table.insert(), data)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1419, in execute
return meth(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/sql/elements.py", line 526, in _execute_on_connection
return connection._execute_clauseelement(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1641, in _execute_clauseelement
ret = self._execute_context(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
return self._exec_single_context(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
self._handle_dbapi_exception(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1936, in _exec_single_context
self.dialect.do_executemany(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 196, in do_executemany
rowcount = cursor.executemany(statement, parameters)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 187, in executemany
return self._do_execute_many(
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 225, in _do_execute_many
rows += self.execute(sql + postfix)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
result = self._query(query)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
conn.query(q)
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
result.read()
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
first_packet = self.connection._read_packet()
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 729, in _read_packet
packet.raise_for_error()
File "/usr/local/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
sqlalchemy.exc.DataError: (pymysql.err.DataError) (1406, "Data too long for column 'broker' at row 1")
[SQL: INSERT INTO future_rank (date, symbol, broker, vol, vol_chg, long_hld, long_chg, short_hld, short_chg, exchange, variety, comd, created_at, updated_at) VALUES (%(date)s, %(symbol)s, %(broker)s, %(vol)s, %(vol_chg)s, %(long_hld)s, %(long_chg)s, %(short_hld)s, %(short_chg)s, %(exchange)s, %(variety)s, %(comd)s, %(created_at)s, %(updated_at)s)]
[parameters: [{'date': '2025-08-13', 'symbol': 'AD', 'broker': '期货公司会员/境外特殊经纪参与者', 'vol': 4696.0, 'vol_chg': 2504.0, 'long_hld': 10202.0, 'long_chg': 34.0, 'short_hld': 10202.0, 'short_chg': 34.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666041), 'updated_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666459)}, {'date': '2025-08-13', 'symbol': 'AD', 'broker': '非期货公司会员/境外特殊非经纪参与者', 'vol': 0.0, 'vol_chg': 0.0, 'long_hld': 0.0, 'long_chg': 0.0, 'short_hld': 0.0, 'short_chg': 0.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666041), 'updated_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666459)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '东亚期货', 'vol': None, 'vol_chg': None, 'long_hld': 148.0, 'long_chg': 3.0, 'short_hld': None, 'short_chg': None, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666041), 'updated_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666459)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '东吴期货', 'vol': 86.0, 'vol_chg': 40.0, 'long_hld': None, 'long_chg': None, 'short_hld': 191.0, 'short_chg': 22.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666041), 'updated_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666459)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '东海期货', 'vol': 151.0, 'vol_chg': 89.0, 'long_hld': 225.0, 'long_chg': 25.0, 'short_hld': None, 'short_chg': None, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666041), 'updated_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666459)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '东证期货', 'vol': 138.0, 'vol_chg': 77.0, 'long_hld': 841.0, 'long_chg': -40.0, 'short_hld': 583.0, 'short_chg': -2.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666041), 'updated_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666459)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '中信建投', 'vol': 237.0, 'vol_chg': 217.0, 'long_hld': None, 'long_chg': None, 'short_hld': 252.0, 'short_chg': -197.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666041), 'updated_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666459)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '中信期货', 'vol': 265.0, 'vol_chg': 143.0, 'long_hld': 761.0, 'long_chg': -7.0, 'short_hld': 656.0, 'short_chg': -4.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666041), 'updated_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666459)} ... displaying 10 of 1000 total bound parameter sets ... {'date': '2025-08-13', 'symbol': 'CU2508', 'broker': '五矿期货', 'vol': 1340.0, 'vol_chg': 165.0, 'long_hld': None, 'long_chg': None, 'short_hld': 1335.0, 'short_chg': -910.0, 'exchange': 'SHFE', 'variety': 'CU', 'comd': 'cu', 'created_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666041), 'updated_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666459)}, {'date': '2025-08-13', 'symbol': 'CU2508', 'broker': '光大期货', 'vol': 870.0, 'vol_chg': 200.0, 'long_hld': 180.0, 'long_chg': -235.0, 'short_hld': 320.0, 'short_chg': -255.0, 'exchange': 'SHFE', 'variety': 'CU', 'comd': 'cu', 'created_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666041), 'updated_at': datetime.datetime(2025, 8, 13, 18, 28, 6, 666459)}]]
(Background on this error at: https://sqlalche.me/e/20/9h9h)
=========================================================================
2025-08-13 18:29:01 Wed START TASK.01 future_1d future_rank
=========================================================================
2025-08-13 18:29:03,198 - future_1d - INFO - future_rank check=True check_last=7 start...
2025-08-13 18:29:03,283 - future_1d - INFO - future_rank date = 2025-08-05
2025-08-13 18:29:03,383 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='GFEX) done
2025-08-13 18:29:03,501 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='CFFEX) done
2025-08-13 18:29:03,665 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='DCE) done
2025-08-13 18:29:03,728 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='INE) done
2025-08-13 18:29:03,909 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='SHFE) done
2025-08-13 18:29:04,104 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='CZCE) done
2025-08-13 18:29:04,780 - future_1d - INFO - save future_rank 2025-08-05 completed
2025-08-13 18:29:12,979 - future_1d - INFO - future_rank date = 2025-08-06
2025-08-13 18:29:13,096 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='GFEX) done
2025-08-13 18:29:13,201 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='CFFEX) done
2025-08-13 18:29:13,355 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='DCE) done
2025-08-13 18:29:13,520 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='INE) done
2025-08-13 18:29:13,678 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='SHFE) done
2025-08-13 18:29:13,862 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='CZCE) done
2025-08-13 18:29:14,550 - future_1d - INFO - save future_rank 2025-08-06 completed
2025-08-13 18:29:24,320 - future_1d - INFO - future_rank date = 2025-08-07
2025-08-13 18:29:24,431 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='GFEX) done
2025-08-13 18:29:24,527 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='CFFEX) done
2025-08-13 18:29:24,670 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='DCE) done
2025-08-13 18:29:24,736 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='INE) done
2025-08-13 18:29:24,943 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='SHFE) done
2025-08-13 18:29:25,141 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='CZCE) done
2025-08-13 18:29:25,790 - future_1d - INFO - save future_rank 2025-08-07 completed
2025-08-13 18:29:35,410 - future_1d - INFO - future_rank date = 2025-08-08
2025-08-13 18:29:35,527 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='GFEX) done
2025-08-13 18:29:35,635 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='CFFEX) done
2025-08-13 18:29:35,786 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='DCE) done
2025-08-13 18:29:35,863 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='INE) done
2025-08-13 18:29:36,017 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='SHFE) done
2025-08-13 18:29:36,208 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='CZCE) done
2025-08-13 18:29:36,905 - future_1d - INFO - save future_rank 2025-08-08 completed
2025-08-13 18:29:46,900 - future_1d - INFO - future_rank date = 2025-08-11
2025-08-13 18:29:47,019 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='GFEX) done
2025-08-13 18:29:47,152 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='CFFEX) done
2025-08-13 18:29:47,235 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='DCE) done
2025-08-13 18:29:47,298 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='INE) done
2025-08-13 18:29:47,461 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='SHFE) done
2025-08-13 18:29:47,648 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='CZCE) done
2025-08-13 18:29:48,168 - future_1d - INFO - save future_rank 2025-08-11 completed
2025-08-13 18:29:57,357 - future_1d - INFO - future_rank date = 2025-08-12
2025-08-13 18:29:57,481 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='GFEX) done
2025-08-13 18:29:57,571 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='CFFEX) done
2025-08-13 18:29:57,652 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='DCE) done
2025-08-13 18:29:57,732 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='INE) done
2025-08-13 18:29:57,900 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='SHFE) done
2025-08-13 18:29:58,087 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='CZCE) done
2025-08-13 18:29:58,615 - future_1d - INFO - save future_rank 2025-08-12 completed
2025-08-13 18:30:06,834 - future_1d - INFO - future_rank date = 2025-08-13
2025-08-13 18:30:06,921 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='GFEX) done
2025-08-13 18:30:07,081 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='CFFEX) done
2025-08-13 18:30:07,172 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='DCE) done
2025-08-13 18:30:07,249 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='INE) done
2025-08-13 18:30:07,399 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='SHFE) done
2025-08-13 18:30:07,710 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='CZCE) done
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1936, in _exec_single_context
self.dialect.do_executemany(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 196, in do_executemany
rowcount = cursor.executemany(statement, parameters)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 187, in executemany
return self._do_execute_many(
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 225, in _do_execute_many
rows += self.execute(sql + postfix)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
result = self._query(query)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
conn.query(q)
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
result.read()
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
first_packet = self.connection._read_packet()
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 729, in _read_packet
packet.raise_for_error()
File "/usr/local/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.DataError: (1406, "Data too long for column 'broker' at row 720")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/project/future_1d/future_rank.py", line 8, in
client.save_future_rank(check=True, check_last=7)
File "/root/project/future_1d/future1d_request.py", line 976, in save_future_rank
data_add.to_sql(tablebase.__tablename__, self.engine, index=False, if_exists='append', chunksize=1000)
File "/usr/local/lib/python3.10/site-packages/pandas/util/_decorators.py", line 333, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/pandas/core/generic.py", line 3106, in to_sql
return sql.to_sql(
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 844, in to_sql
return pandas_sql.to_sql(
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 2030, in to_sql
total_inserted = sql_engine.insert_records(
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1579, in insert_records
raise err
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1570, in insert_records
return table.insert(chunksize=chunksize, method=method)
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1121, in insert
num_inserted = exec_insert(conn, keys, chunk_iter)
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1012, in _execute_insert
result = conn.execute(self.table.insert(), data)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1419, in execute
return meth(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/sql/elements.py", line 526, in _execute_on_connection
return connection._execute_clauseelement(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1641, in _execute_clauseelement
ret = self._execute_context(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
return self._exec_single_context(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
self._handle_dbapi_exception(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1936, in _exec_single_context
self.dialect.do_executemany(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 196, in do_executemany
rowcount = cursor.executemany(statement, parameters)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 187, in executemany
return self._do_execute_many(
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 225, in _do_execute_many
rows += self.execute(sql + postfix)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
result = self._query(query)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
conn.query(q)
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
result.read()
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
first_packet = self.connection._read_packet()
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 729, in _read_packet
packet.raise_for_error()
File "/usr/local/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
sqlalchemy.exc.DataError: (pymysql.err.DataError) (1406, "Data too long for column 'broker' at row 720")
[SQL: INSERT INTO future_rank (date, symbol, broker, vol, vol_chg, long_hld, long_chg, short_hld, short_chg, exchange, variety, comd, created_at, updated_at) VALUES (%(date)s, %(symbol)s, %(broker)s, %(vol)s, %(vol_chg)s, %(long_hld)s, %(long_chg)s, %(short_hld)s, %(short_chg)s, %(exchange)s, %(variety)s, %(comd)s, %(created_at)s, %(updated_at)s)]
[parameters: [{'date': '2025-08-13', 'symbol': 'IF2508', 'broker': '东海期货(代客)', 'vol': None, 'vol_chg': None, 'long_hld': None, 'long_chg': None, 'short_hld': 233.0, 'short_chg': -127.0, 'exchange': 'CFFEX', 'variety': 'IF', 'comd': 'IF', 'created_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808047), 'updated_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808472)}, {'date': '2025-08-13', 'symbol': 'IF2508', 'broker': '东证期货(代客)', 'vol': 4140.0, 'vol_chg': -368.0, 'long_hld': 1705.0, 'long_chg': -133.0, 'short_hld': 1917.0, 'short_chg': 343.0, 'exchange': 'CFFEX', 'variety': 'IF', 'comd': 'IF', 'created_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808047), 'updated_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808472)}, {'date': '2025-08-13', 'symbol': 'IF2508', 'broker': '中信建投(代客)', 'vol': 1959.0, 'vol_chg': 296.0, 'long_hld': 317.0, 'long_chg': -788.0, 'short_hld': 224.0, 'short_chg': -881.0, 'exchange': 'CFFEX', 'variety': 'IF', 'comd': 'IF', 'created_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808047), 'updated_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808472)}, {'date': '2025-08-13', 'symbol': 'IF2508', 'broker': '中信期货(代客)', 'vol': 11586.0, 'vol_chg': 2761.0, 'long_hld': 4297.0, 'long_chg': 7.0, 'short_hld': 8833.0, 'short_chg': -1961.0, 'exchange': 'CFFEX', 'variety': 'IF', 'comd': 'IF', 'created_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808047), 'updated_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808472)}, {'date': '2025-08-13', 'symbol': 'IF2508', 'broker': '中泰期货(代客)', 'vol': 615.0, 'vol_chg': -16.0, 'long_hld': 284.0, 'long_chg': -117.0, 'short_hld': 197.0, 'short_chg': -90.0, 'exchange': 'CFFEX', 'variety': 'IF', 'comd': 'IF', 'created_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808047), 'updated_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808472)}, {'date': '2025-08-13', 'symbol': 'IF2508', 'broker': '中金财富(代客)', 'vol': 722.0, 'vol_chg': 27.0, 'long_hld': 435.0, 'long_chg': -136.0, 'short_hld': None, 'short_chg': None, 'exchange': 'CFFEX', 'variety': 'IF', 'comd': 'IF', 'created_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808047), 'updated_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808472)}, {'date': '2025-08-13', 'symbol': 'IF2508', 'broker': '中银期货(代客)', 'vol': None, 'vol_chg': None, 'long_hld': None, 'long_chg': None, 'short_hld': 700.0, 'short_chg': -355.0, 'exchange': 'CFFEX', 'variety': 'IF', 'comd': 'IF', 'created_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808047), 'updated_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808472)}, {'date': '2025-08-13', 'symbol': 'IF2508', 'broker': '五矿期货(代客)', 'vol': 539.0, 'vol_chg': 162.0, 'long_hld': None, 'long_chg': None, 'short_hld': None, 'short_chg': None, 'exchange': 'CFFEX', 'variety': 'IF', 'comd': 'IF', 'created_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808047), 'updated_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808472)} ... displaying 10 of 1000 total bound parameter sets ... {'date': '2025-08-13', 'symbol': 'AL2508', 'broker': '招商期货', 'vol': None, 'vol_chg': None, 'long_hld': None, 'long_chg': None, 'short_hld': 180.0, 'short_chg': -95.0, 'exchange': 'SHFE', 'variety': 'AL', 'comd': 'al', 'created_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808047), 'updated_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808472)}, {'date': '2025-08-13', 'symbol': 'AL2508', 'broker': '新湖期货', 'vol': None, 'vol_chg': None, 'long_hld': None, 'long_chg': None, 'short_hld': 75.0, 'short_chg': -30.0, 'exchange': 'SHFE', 'variety': 'AL', 'comd': 'al', 'created_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808047), 'updated_at': datetime.datetime(2025, 8, 13, 18, 30, 7, 808472)}]]
(Background on this error at: https://sqlalche.me/e/20/9h9h)
=========================================================================
2025-08-13 18:31:12 Wed START TASK.01 future_1d future_rank
=========================================================================
2025-08-13 18:31:14,704 - future_1d - INFO - future_rank check=True check_last=7 start...
2025-08-13 18:31:14,786 - future_1d - INFO - future_rank date = 2025-08-05
2025-08-13 18:31:14,911 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='INE) done
2025-08-13 18:31:15,083 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='DCE) done
2025-08-13 18:31:15,260 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='SHFE) done
2025-08-13 18:31:15,368 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='GFEX) done
2025-08-13 18:31:15,580 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='CZCE) done
2025-08-13 18:31:15,700 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-05',exchange='CFFEX) done
2025-08-13 18:31:16,386 - future_1d - INFO - save future_rank 2025-08-05 completed
2025-08-13 18:31:19,608 - future_1d - INFO - future_rank date = 2025-08-06
2025-08-13 18:31:19,676 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='INE) done
2025-08-13 18:31:20,100 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='DCE) done
2025-08-13 18:31:20,378 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='SHFE) done
2025-08-13 18:31:20,472 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='GFEX) done
2025-08-13 18:31:20,707 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='CZCE) done
2025-08-13 18:31:20,815 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-06',exchange='CFFEX) done
2025-08-13 18:31:21,542 - future_1d - INFO - save future_rank 2025-08-06 completed
2025-08-13 18:31:26,047 - future_1d - INFO - future_rank date = 2025-08-07
2025-08-13 18:31:26,130 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='INE) done
2025-08-13 18:31:26,305 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='DCE) done
2025-08-13 18:31:26,461 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='SHFE) done
2025-08-13 18:31:26,667 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='GFEX) done
2025-08-13 18:31:27,192 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='CZCE) done
2025-08-13 18:31:27,290 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-07',exchange='CFFEX) done
2025-08-13 18:31:27,961 - future_1d - INFO - save future_rank 2025-08-07 completed
2025-08-13 18:31:30,992 - future_1d - INFO - future_rank date = 2025-08-08
2025-08-13 18:31:31,073 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='INE) done
2025-08-13 18:31:31,600 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='DCE) done
2025-08-13 18:31:31,797 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='SHFE) done
2025-08-13 18:31:31,943 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='GFEX) done
2025-08-13 18:31:32,210 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='CZCE) done
2025-08-13 18:31:32,477 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-08',exchange='CFFEX) done
2025-08-13 18:31:33,199 - future_1d - INFO - save future_rank 2025-08-08 completed
2025-08-13 18:31:40,346 - future_1d - INFO - future_rank date = 2025-08-11
2025-08-13 18:31:40,478 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='INE) done
2025-08-13 18:31:40,575 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='DCE) done
2025-08-13 18:31:40,725 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='SHFE) done
2025-08-13 18:31:40,840 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='GFEX) done
2025-08-13 18:31:41,572 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='CZCE) done
2025-08-13 18:31:41,743 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-11',exchange='CFFEX) done
2025-08-13 18:31:42,316 - future_1d - INFO - save future_rank 2025-08-11 completed
2025-08-13 18:31:50,915 - future_1d - INFO - future_rank date = 2025-08-12
2025-08-13 18:31:50,997 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='INE) done
2025-08-13 18:31:51,107 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='DCE) done
2025-08-13 18:31:51,841 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='SHFE) done
2025-08-13 18:31:51,942 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='GFEX) done
2025-08-13 18:31:52,534 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='CZCE) done
2025-08-13 18:31:52,640 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-12',exchange='CFFEX) done
2025-08-13 18:31:53,172 - future_1d - INFO - save future_rank 2025-08-12 completed
2025-08-13 18:31:56,245 - future_1d - INFO - future_rank date = 2025-08-13
2025-08-13 18:31:56,308 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='INE) done
2025-08-13 18:31:56,386 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='DCE) done
2025-08-13 18:31:56,559 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='SHFE) done
2025-08-13 18:31:56,669 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='GFEX) done
2025-08-13 18:31:56,862 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='CZCE) done
2025-08-13 18:31:56,970 - future_1d - INFO - pro.fut_holding(trade_date='2025-08-13',exchange='CFFEX) done
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1936, in _exec_single_context
self.dialect.do_executemany(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 196, in do_executemany
rowcount = cursor.executemany(statement, parameters)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 187, in executemany
return self._do_execute_many(
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 225, in _do_execute_many
rows += self.execute(sql + postfix)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
result = self._query(query)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
conn.query(q)
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
result.read()
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
first_packet = self.connection._read_packet()
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 729, in _read_packet
packet.raise_for_error()
File "/usr/local/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.DataError: (1406, "Data too long for column 'broker' at row 1")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/project/future_1d/future_rank.py", line 8, in
client.save_future_rank(check=True, check_last=7)
File "/root/project/future_1d/future1d_request.py", line 976, in save_future_rank
data_add.to_sql(tablebase.__tablename__, self.engine, index=False, if_exists='append', chunksize=1000)
File "/usr/local/lib/python3.10/site-packages/pandas/util/_decorators.py", line 333, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/pandas/core/generic.py", line 3106, in to_sql
return sql.to_sql(
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 844, in to_sql
return pandas_sql.to_sql(
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 2030, in to_sql
total_inserted = sql_engine.insert_records(
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1579, in insert_records
raise err
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1570, in insert_records
return table.insert(chunksize=chunksize, method=method)
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1121, in insert
num_inserted = exec_insert(conn, keys, chunk_iter)
File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1012, in _execute_insert
result = conn.execute(self.table.insert(), data)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1419, in execute
return meth(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/sql/elements.py", line 526, in _execute_on_connection
return connection._execute_clauseelement(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1641, in _execute_clauseelement
ret = self._execute_context(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
return self._exec_single_context(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
self._handle_dbapi_exception(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1936, in _exec_single_context
self.dialect.do_executemany(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 196, in do_executemany
rowcount = cursor.executemany(statement, parameters)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 187, in executemany
return self._do_execute_many(
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 225, in _do_execute_many
rows += self.execute(sql + postfix)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
result = self._query(query)
File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
conn.query(q)
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
result.read()
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
first_packet = self.connection._read_packet()
File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 729, in _read_packet
packet.raise_for_error()
File "/usr/local/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
sqlalchemy.exc.DataError: (pymysql.err.DataError) (1406, "Data too long for column 'broker' at row 1")
[SQL: INSERT INTO future_rank (date, symbol, broker, vol, vol_chg, long_hld, long_chg, short_hld, short_chg, exchange, variety, comd, created_at, updated_at) VALUES (%(date)s, %(symbol)s, %(broker)s, %(vol)s, %(vol_chg)s, %(long_hld)s, %(long_chg)s, %(short_hld)s, %(short_chg)s, %(exchange)s, %(variety)s, %(comd)s, %(created_at)s, %(updated_at)s)]
[parameters: [{'date': '2025-08-13', 'symbol': 'AD', 'broker': '期货公司会员/境外特殊经纪参与者', 'vol': 4696.0, 'vol_chg': 2504.0, 'long_hld': 10202.0, 'long_chg': 34.0, 'short_hld': 10202.0, 'short_chg': 34.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68461), 'updated_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68897)}, {'date': '2025-08-13', 'symbol': 'AD', 'broker': '非期货公司会员/境外特殊非经纪参与者', 'vol': 0.0, 'vol_chg': 0.0, 'long_hld': 0.0, 'long_chg': 0.0, 'short_hld': 0.0, 'short_chg': 0.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68461), 'updated_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68897)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '东亚期货', 'vol': None, 'vol_chg': None, 'long_hld': 148.0, 'long_chg': 3.0, 'short_hld': None, 'short_chg': None, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68461), 'updated_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68897)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '东吴期货', 'vol': 86.0, 'vol_chg': 40.0, 'long_hld': None, 'long_chg': None, 'short_hld': 191.0, 'short_chg': 22.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68461), 'updated_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68897)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '东海期货', 'vol': 151.0, 'vol_chg': 89.0, 'long_hld': 225.0, 'long_chg': 25.0, 'short_hld': None, 'short_chg': None, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68461), 'updated_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68897)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '东证期货', 'vol': 138.0, 'vol_chg': 77.0, 'long_hld': 841.0, 'long_chg': -40.0, 'short_hld': 583.0, 'short_chg': -2.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68461), 'updated_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68897)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '中信建投', 'vol': 237.0, 'vol_chg': 217.0, 'long_hld': None, 'long_chg': None, 'short_hld': 252.0, 'short_chg': -197.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68461), 'updated_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68897)}, {'date': '2025-08-13', 'symbol': 'AD2511', 'broker': '中信期货', 'vol': 265.0, 'vol_chg': 143.0, 'long_hld': 761.0, 'long_chg': -7.0, 'short_hld': 656.0, 'short_chg': -4.0, 'exchange': 'SHFE', 'variety': 'AD', 'comd': 'ad', 'created_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68461), 'updated_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68897)} ... displaying 10 of 1000 total bound parameter sets ... {'date': '2025-08-13', 'symbol': 'CU2508', 'broker': '五矿期货', 'vol': 1340.0, 'vol_chg': 165.0, 'long_hld': None, 'long_chg': None, 'short_hld': 1335.0, 'short_chg': -910.0, 'exchange': 'SHFE', 'variety': 'CU', 'comd': 'cu', 'created_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68461), 'updated_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68897)}, {'date': '2025-08-13', 'symbol': 'CU2508', 'broker': '光大期货', 'vol': 870.0, 'vol_chg': 200.0, 'long_hld': 180.0, 'long_chg': -235.0, 'short_hld': 320.0, 'short_chg': -255.0, 'exchange': 'SHFE', 'variety': 'CU', 'comd': 'cu', 'created_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68461), 'updated_at': datetime.datetime(2025, 8, 13, 18, 31, 57, 68897)}]]
(Background on this error at: https://sqlalche.me/e/20/9h9h)