0

I am trying to use the cassandrapython cqlengine for accessing the cassandra db, I was able to filter when the columns are not of list type.

I get the following error message :

d =cClass().filter(lastname='text',age=2,input__contains='a') 

Traceback (most recent call last):   
File "/usr/local/lib/python3.4/dist-packages/cqlengine-0.21.0-py3.4.egg/cqlengine/operators.py", line 43, 
    in get_operator KeyError: 'CONTAINS'  During handling of the above exception, another exception occurred:  
Traceback (most recent call last):   
File "<stdin>", line 1, in <module>   
File "/usr/local/lib/python3.4/dist-packages/cqlengine-0.21.0-py3.4.egg/cqlengine/models.py", line 562, in filter   
File "/usr/local/lib/python3.4/dist-packages/cqlengine-0.21.0-py3.4.egg/cqlengine/query.py", line 507, in filter   
File "/usr/local/lib/python3.4/dist-packages/cqlengine-0.21.0-py3.4.egg/cqlengine/operators.py", line 45, 
    in get_operator **cqlengine.operators.QueryOperatorException: contains doesn't map to a QueryOperator**
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • Look at this: http://stackoverflow.com/questions/25076283 . I guess it is the same issue. – rajpy Oct 17 '16 at 06:44

1 Answers1

0

It looks like you're using a very old (and deprecated) version of cqlengine. If you can, upgrade to the version integrated with the DataStax driver, where the API has supported contains since version 3.1.0.

Adam Holmberg
  • 7,245
  • 3
  • 30
  • 53