pythonstock / stock

stock,股票系统。使用python进行开发。
Apache License 2.0
6.64k stars 2.22k forks source link

执行 guess_indicators_lite_sell_daily_job 报错了。 #14

Closed golangpkg closed 4 years ago

golangpkg commented 4 years ago

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/data/stock/libs/common.py", line 160, in run_with_args run_fun(tmp_datetime_show) # 使用当前时间 File "/data/stock/jobs/guess_indicators_lite_buy_daily_job.py", line 50, in stat_all_lite del stock_merge["date"] # 合并前删除 date 字段。 File "/usr/local/lib/python3.6/site-packages/pandas/core/generic.py", line 3759, in delitem self._data.delete(key) File "/usr/local/lib/python3.6/site-packages/pandas/core/internals/managers.py", line 1591, in delete loc = self.items.get_loc(item) File "/usr/local/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2648, in get_loc return self._engine.get_loc(self._maybe_cast_indexer(key)) File "pandas/_libs/index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/index.pyx", line 135, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/index_class_helper.pxi", line 109, in pandas._libs.index.Int64Engine._check_type KeyError: 'date' Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1278, in _execute_context cursor, statement, parameters, context File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute cursor.execute(statement, parameters) File "/usr/local/lib/python3.6/site-packages/MySQLdb/cursors.py", line 206, in execute res = self._query(query) File "/usr/local/lib/python3.6/site-packages/MySQLdb/cursors.py", line 319, in _query db.query(q) File "/usr/local/lib/python3.6/site-packages/MySQLdb/connections.py", line 259, in query _mysql.connection.query(self, query) MySQLdb._exceptions.ProgrammingError: (1146, "Table 'stock_data.guess_indicators_lite_buy_daily' doesn't exist")

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/data/stock/libs/common.py", line 160, in run_with_args run_fun(tmp_datetime_show) # 使用当前时间 File "/data/stock/jobs/guess_indicators_lite_sell_daily_job.py", line 84, in stat_index_calculate data = pd.read_sql(sql=sql_1, con=common.engine(), params=[]) File "/usr/local/lib/python3.6/site-packages/pandas/io/sql.py", line 438, in read_sql chunksize=chunksize, File "/usr/local/lib/python3.6/site-packages/pandas/io/sql.py", line 1218, in read_query result = self.execute(args) File "/usr/local/lib/python3.6/site-packages/pandas/io/sql.py", line 1087, in execute return self.connectable.execute(args, *kwargs) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2238, in execute return connection.execute(statement, multiparams, **params) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1006, in execute return self._executetext(object, multiparams, params) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1181, in _execute_text parameters, File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1318, in _execute_context e, statement, parameters, cursor, context File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1512, in _handle_dbapi_exception sqlalchemy_exception, with_traceback=excinfo[2], from=e File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_ raise exception File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1278, in _execute_context cursor, statement, parameters, context File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute cursor.execute(statement, parameters) File "/usr/local/lib/python3.6/site-packages/MySQLdb/cursors.py", line 206, in execute res = self._query(query) File "/usr/local/lib/python3.6/site-packages/MySQLdb/cursors.py", line 319, in _query db.query(q) File "/usr/local/lib/python3.6/site-packages/MySQLdb/connections.py", line 259, in query _mysql.connection.query(self, query) sqlalchemy.exc.ProgrammingError: (MySQLdb._exceptions.ProgrammingError) (1146, "Table 'stock_data.guess_indicators_lite_buy_daily' doesn't exist") [SQL:
SELECT buy_date, code, name, changepercent, trade, turnoverratio, pb, kdjj, rsi_6, cci, wave_base, wave_crest, wave_mean, up_rate FROM guess_indicators_lite_buy_daily where buy_date <= 20200711] (Background on this error at: http://sqlalche.me/e/13/f405)