CQL TypeError:接收到列的无效类型参数

2024-06-23 20:03:22 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用Cassandra Python driver,我创建了一个表,在表中有一列(称为date)被定义为timestamp。我尝试从数据帧访问值,并使用这些值将行插入表中。与date对应的dataframe值的格式为(从PyCharm调试模式捕获)

Timestamp('2006-09-29 00:00:00')

但我有以下错误

TypeError: Received an argument of invalid type for column "date". Expected: <class 'cassandra.cqltypes.DateType'>, Got: <class 'str'>; (DateType arguments must be a datetime, date, or timestamp)

表格定义为

^{pr2}$

更新

问题是由于数据帧中有nat,在插入cassandra之前忘记删除它们。在


Tags: 数据dataframedate定义格式driver错误timestamp

热门问题