Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/xxx/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/201.8538.36/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "/Users/xxx/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/201.8538.36/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/xxx/zvt-tm/zvt_tm/reports/report_crypto_tm.py", line 79, in <module>
level=IntervalLevel.LEVEL_1DAY)
File "/usr/local/lib/python3.7/site-packages/zvt/factors/ma/ma_factor.py", line 122, in __init__
accumulator, need_persist, dry_run)
File "/usr/local/lib/python3.7/site-packages/zvt/factors/technical_factor.py", line 49, in __init__
effective_number, transformer, accumulator, need_persist, dry_run)
File "/usr/local/lib/python3.7/site-packages/zvt/factors/factor.py", line 120, in __init__
category_field, time_field, computing_window)
File "/usr/local/lib/python3.7/site-packages/zvt/contract/reader.py", line 139, in __init__
self.load_data()
File "/usr/local/lib/python3.7/site-packages/zvt/contract/reader.py", line 170, in load_data
time_field=self.time_field)
File "/usr/local/lib/python3.7/site-packages/zvt/contract/schema.py", line 85, in query_data
filters=filters, session=session, order=order, limit=limit, index=index, time_field=time_field)
File "/usr/local/lib/python3.7/site-packages/zvt/contract/api.py", line 328, in get_data
df = pd.read_sql(query.statement, query.session.bind)
File "/usr/local/lib/python3.7/site-packages/pandas/io/sql.py", line 410, in read_sql
chunksize=chunksize,
File "/usr/local/lib/python3.7/site-packages/pandas/io/sql.py", line 1645, in read_query
cursor = self.execute(*args)
File "/usr/local/lib/python3.7/site-packages/pandas/io/sql.py", line 1590, in execute
cur = self.con.cursor()
AttributeError: 'NoneType' object has no attribute 'cursor'
尝试接入baostock日k,测试的recorder如下
尝试直接修改zvt/domain/quotes/stock/stock_1d_kdata.py
抓取数据正常,使用factor没问题
尝试将
移动到单独插件,则出现问题。
报错堆栈
调试信息如下
session的bind为空,正常应该不为空