dolphindb / api_python3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

利用 tableAppender 插入数据会报 Warning

hanqichen opened this issue · comments

数据插入代码为:
appender = ddb.tableAppender(db_path, db_table, session)
appender.append(table_data)

上述代码运行会触发 Warning:
dolphindb/session.py:1176: UserWarning: Pandas doesn't allow columns to be created via a new attribute name - see https://pandas.pydata.org/pandas-docs/stable/indexing.html#attribute-access

我的版本信息为:
dolphindb 1.30.21.2
pandas 1.5.2

请问这个报警会影响程序正确性么?如果是,应该如何修正?

在1.30.19.4及之后版本的 Python API 中,用户在使用 TableAppender 类的 append 方法写入数据时,可能会收到如下警告:
UserWarning: Pandas doesn't allow columns to be created via a new attribute name - see https://pandas.pydata.org/pandas-docs/stable/indexing.html#attribute-access
该警告并不会对程序执行造成任何影响,如需屏蔽,可以使用如下方法:
import warnings
warnings.filterwarnings("ignore","Pandas doesn't allow columns to be created via a new attribute name - see
https://pandas.pydata.org/pandas-docs/stable/indexing.html#attribute-access", UserWarning)

好的,谢谢