Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Cassandra AttributeError:“PrepareMessage”对象没有“consistency\u level”属性_Python_Cassandra_Attributes - Fatal编程技术网

Python Cassandra AttributeError:“PrepareMessage”对象没有“consistency\u level”属性

Python Cassandra AttributeError:“PrepareMessage”对象没有“consistency\u level”属性,python,cassandra,attributes,Python,Cassandra,Attributes,并非每次都能看到此错误。当应用程序运行多次时,我们已经看到了这个问题。 有人能帮我吗 sql_query = 'SELECT * FROM hourly_table where mac=? and name=? and processedhour >= ? and processedhour < ? ;' Traceback (most recent call last): File "/opt/Extraction/main/CassandraOps.py"

并非每次都能看到此错误。当应用程序运行多次时,我们已经看到了这个问题。 有人能帮我吗

sql_query = 'SELECT * FROM hourly_table where mac=? and name=? and processedhour >= ? and processedhour < ? ;'

Traceback (most recent call last):
  File "/opt/Extraction/main/CassandraOps.py", line 1229, in selectConcurrent
    select_statement = session.prepare(sql_query)
  File "cassandra/cluster.py", line 2496, in cassandra.cluster.Session.prepare (cassandra/cluster.c:43515)
    raise
  File "cassandra/cluster.py", line 2493, in cassandra.cluster.Session.prepare (cassandra/cluster.c:43365)
    query_id, bind_metadata, pk_indexes, result_metadata, result_metadata_id = future.result()
  File "cassandra/cluster.py", line 4198, in cassandra.cluster.ResponseFuture.result (cassandra/cluster.c:80578)
    raise self._final_exception
AttributeError: 'PrepareMessage' object has no attribute 'consistency_level'

这看起来像是Python编码问题,而不是Cassandra特有的


我建议您检查代码,尤其是在创建准备好的语句时,并检查错误。例如,代码部分可能没有正确缩进,从而导致您发布的错误。干杯

谢谢你,埃里克·拉米雷斯。让我检查一下,它对我有用。这是一个代码问题。谢谢你@Erick RamirezGood听我说。干杯