我这边自己合成BarData数据想保存到mysql中去,调用vnpy.trader.database.BaseDatabase.save_bar_data方法报错
请大佬们帮忙看看~
错误信息
Traceback (most recent call last):
File "D:/PyCharm/plugins/python-ce/helpers/pydev/pydevd.py", line 1496, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "D:\PyCharm\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:/py_workspaces/vnpy/utils/load_from_baostock.py", line 101, in <module>
load_insert_db('sh.600000', '2022-09-01', '2022-10-01')
File "D:/py_workspaces/vnpy/utils/load_from_baostock.py", line 53, in load_insert_db
database.save_bar_data(bar_datas)
File "C:\ProgramData\Anaconda3\envs\vnpy\lib\site-packages\vnpy_mysql\mysql_database.py", line 180, in save_bar_data
d["exchange"] = d["exchange"].value
TypeError: 'mappingproxy' object does not support item assignment
代码片段:
database = get_database()
bar_datas = pd2BarData(df, frequency)
database.save_bar_data(bar_datas)