Issue with cassandra-driver 3.0.0

1,703 views
Skip to first unread message

scalp42

unread,
Dec 8, 2015, 8:30:29 PM12/8/15
to DataStax Python Driver for Apache Cassandra User Mailing List
Hi,

I'm running into an issue which I believe is related to cassandra-driver update.

When using cassandra-driver==2.7.2:

root@data-i-33b65ce9 [gz-dev3] ~ # /usr/local/bin/cqlsh --cqlversion 3.3.1 -u cassandra -p cassandra gz-dev3.cassandra-main.service.consul
Connected to Test Cluster at gz-dev3.cassandra-main.service.consul:9042.
[cqlsh 5.0.1 | Cassandra 2.2.3 | CQL spec 3.3.1 | Native protocol v4]
Use HELP for help.
cassandra@cqlsh
>

When using cassandra-driver==3.0.0:

root@data-i-0e9144d4 [gz-dev1] ~ # /usr/local/bin/cqlsh --cqlversion 3.3.1 -u cassandra -p cassandra
Traceback (most recent call last):
 
File "/usr/local/bin/cqlsh", line 111, in <module>
   
from cassandra.cluster import Cluster, PagedResult
ImportError: cannot import name PagedResult

Because we need cqlsh only on some the boxes (and we dont want to install Cassandra), we use a fork of cqlsh from Github:

pip install git+https://github.com/spiside/cqls...@v5.0.2

It's been working fine until the change in cassandra-driver version.

This is currently a blocker for us, any help would be greatly appreciated.

scalp42

unread,
Dec 8, 2015, 8:32:34 PM12/8/15
to DataStax Python Driver for Apache Cassandra User Mailing List
Forgot to add Python version:

root@data-i-0e9144d4 [gz-dev1] ~ # python --version
Python 2.7.6

Greg Bestland

unread,
Dec 8, 2015, 8:47:35 PM12/8/15
to python-dr...@lists.datastax.com
Hi,

This is likely a result of some breaking API changes that were made in the 3.0 version of the driver. I believe in this specific case the PagedResult class was replaced with ResultSet class in the 3.0 version of the driver. I can respond in a little more depth tomorrow, but I would believe that the version of cqlsh that you are using has not been updated to work with the 3.0 version of the driver. 

~Thanks
Greg Bestland.

--
You received this message because you are subscribed to the Google Groups "DataStax Python Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-driver-u...@lists.datastax.com.



--


Adam Holmberg

unread,
Dec 9, 2015, 10:50:14 AM12/9/15
to python-dr...@lists.datastax.com
Confirming what Greg mentioned: Driver 3.0 had some API changes (which you can read about here). Cassandra cqlsh was updated to that API in Cassandra 3.0. If you're using and earlier version of cqlsh, stick with driver < 3.0. Ideally you could even use the exact version bundled with your version of cqlsh by making lib/cassandra-driver-internal-only*zip part of your repo.

Regards,
Adam Holmberg

scalp42

unread,
Dec 9, 2015, 2:34:59 PM12/9/15
to DataStax Python Driver for Apache Cassandra User Mailing List
Thanks for the help!

Any idea where to find that internal only zip please ?

scalp42

unread,
Dec 9, 2015, 2:37:22 PM12/9/15
to DataStax Python Driver for Apache Cassandra User Mailing List
I'm looking at https://github.com/apache/cassandra/tree/cassandra-2.2 trying to find cqlsh but I can't find it in there.

I see the pylib directory, but not the actual cqlsh cli.

Adam Holmberg

unread,
Dec 9, 2015, 2:37:42 PM12/9/15
to python-dr...@lists.datastax.com
It's right there in the Cassandra project under this glob:
lib/cassandra-driver-internal-only*zip


On Wed, Dec 9, 2015 at 1:34 PM, scalp42 <scal...@gmail.com> wrote:
Thanks for the help!

Any idea where to find that internal only zip please ?

--

scalp42

unread,
Dec 9, 2015, 2:41:28 PM12/9/15
to DataStax Python Driver for Apache Cassandra User Mailing List
Looks like it's https://github.com/apache/cassandra/blob/trunk/bin/cqlsh.py

Now off to find the setup.py that goes with it to actually be able to install it through pip for example.

scalp42

unread,
Dec 9, 2015, 3:55:39 PM12/9/15
to DataStax Python Driver for Apache Cassandra User Mailing List
Getting closer.

Only last missing piece is where the cqlsh version comes from (ie "5.0.1"), if anyone know?

Adam Holmberg

unread,
Dec 9, 2015, 4:01:44 PM12/9/15
to python-dr...@lists.datastax.com

On Wed, Dec 9, 2015 at 2:55 PM, scalp42 <scal...@gmail.com> wrote:
Getting closer.

Only last missing piece is where the cqlsh version comes from (ie "5.0.1"), if anyone know?

--

scalp42

unread,
Dec 9, 2015, 4:03:11 PM12/9/15
to DataStax Python Driver for Apache Cassandra User Mailing List
So cqlsh does not actually change, just the underlying driver?

On Wednesday, December 9, 2015 at 1:01:44 PM UTC-8, Adam Holmberg wrote:

scalp42

unread,
Dec 9, 2015, 4:09:39 PM12/9/15
to DataStax Python Driver for Apache Cassandra User Mailing List
If anyone comes across this thread, the idea :


"3" will use cassandra-driver >= 3


Unfortunately it segfaults at the end:

root@data-i-0e9144d4 [gz-dev1] ~ # pip install -I --upgrade --force-reinstall 'git+https://github.com/scalp42/cqlsh@3'
Collecting git+https://github.com/scalp42/cqlsh@3
 
Cloning https://github.com/scalp42/cqlsh (to 3) to /tmp/pip-jJF35P-build
Collecting cql (from cqlsh==3)
Collecting simplejson (from cqlsh==3)
Collecting unittest2 (from cqlsh==3)
 
Using cached unittest2-1.1.0-py2.py3-none-any.whl
Collecting cassandra-driver>=3 (from cqlsh==3)
Collecting thrift (from cql->cqlsh==3)
Collecting argparse (from unittest2->cqlsh==3)
 
Using cached argparse-1.4.0-py2.py3-none-any.whl
Collecting traceback2 (from unittest2->cqlsh==3)
 
Using cached traceback2-1.4.0-py2.py3-none-any.whl
Collecting six>=1.4 (from unittest2->cqlsh==3)
 
Using cached six-1.10.0-py2.py3-none-any.whl
Collecting futures (from cassandra-driver>=3->cqlsh==3)
 
Using cached futures-3.0.3-py2-none-any.whl
Collecting linecache2 (from traceback2->unittest2->cqlsh==3)
 
Using cached linecache2-1.0.0-py2.py3-none-any.whl
Installing collected packages: thrift, cql, simplejson, argparse, linecache2, traceback2, six, unittest2, futures, cassandra-driver, cqlsh
 
Running setup.py install for cqlsh
Successfully installed argparse-1.4.0 cassandra-driver-3.0.0 cql-1.4.0 cqlsh-3 futures-3.0.3 linecache2-1.0.0 simplejson-3.8.1 six-1.10.0 thrift-0.9.3 traceback2-1.4.0 unittest2-1.1.0
Segmentation fault (core dumped)

scalp42

unread,
Dec 9, 2015, 4:11:45 PM12/9/15
to DataStax Python Driver for Apache Cassandra User Mailing List
I think its due to pip itself.

Working finally!

Thanks Adam and Greg for the patience and help.
Reply all
Reply to author
Forward
0 new messages