Questions tagged [cassandra-python-driver]

Python client library for Apache Cassandra

access from python. Provides ORM for cassandra.

This drivers provides:

46 questions
1
vote
1 answer

How to find the first host contacted by cassandra driver during connection?

Is there a way to find out which node was contacted first during the initial setup by the driver? For example, is there a way to find the host 10.9.58.64 that was contacted? WARNING:cassandra.cluster:Cluster.__init__ called with contact_points…
developthou
  • 343
  • 1
  • 10
1
vote
1 answer

Cassandra cluster connect fails each 2nd time with NoHostAvailable

def get_session( keyspace: str = None, consistency_level=settings.CASSANDRA_CONSISTENCY_LEVEL, request_timeout=settings.CASSANDRA_REQUEST_TIMEOUT, ) -> Session: """Initiate connection with apache cassandra cluster. Arguments: …
DmitrySemenov
  • 9,204
  • 15
  • 76
  • 121
1
vote
1 answer

How can we connect to remote Cassandra server with python driver

I am trying to connect to Cassandra with the python driver: from cassandra.cluster import Cluster from cassandra.auth import PlainTextAuthProvider auth_provider = PlainTextAuthProvider(username='yyyy',password='zzzzz') cluster =…
1
vote
1 answer

DS201: How to get value of "type timeuuid" while inserting into cassandra using Python Driver?

This is my first query on the forum so please correct if my understanding are wrong. I am executing exercise Application Driver Connection from DS201. Table is as follows: cqlsh:killrvideo> SELECT * FROM videos_by_tag ; tag | added_date …
naikpd
  • 13
  • 4
1
vote
1 answer

Cassandra schema issue in 2.1.14

We encountered a strange issue when altering a table. We use Cassandra python driver sync_table() method to sync from our model (defined in a py file) to Cassandra. The cluster is a 20 node being stressed decently (all nodes in range of 50-70% max…
Firdousi Farozan
  • 762
  • 1
  • 6
  • 14
1
vote
0 answers

Cassandra ExecutionResult on importlib._bootstrap failed

I am trying to execute multi-process to pull the data from Cassandra. But, I'm facing the issue.I want to pull it for single key or multiple keys using the multi-process provided my Cassandra My cassandra_db class from cassandra.cluster import…
Anji
  • 285
  • 2
  • 7
  • 20
1
vote
1 answer

Cassandra : Delete the data without removing the table structure

I'm running some tests on cassandra, that need the data in the table to be removed after every run. So I wrote a script that TRUNCATES the data. My question is, does it leave the table unconfigured(removes all columns) after I TRUNCATE the table?…
spark_dream
  • 326
  • 2
  • 8
  • 23
1
vote
1 answer

How to pass cassandra function from python cassandra driver?

I have code from uuid import uuid4 from uuid import uuid1 from cassandra.cqlengine import columns, connection from cassandra.cqlengine.models import Model from cassandra.cqlengine.management import sync_table class BaseModel(Model): …
Nilesh
  • 20,521
  • 16
  • 92
  • 148
1
vote
1 answer

Schema not translated completely from Thrift protocol to CQL protocol

I am trying to move from using pycassa to native protocol in my project (which will let us upgrade the version of cassandra). My schema was defined using pycassa so it created a Column family using compact storage and it has 3 columns which are not…
Nitin
  • 280
  • 1
  • 4
  • 12
1
vote
0 answers

How to configure Pyramid + Cassandra + uWSGI (forking mode)

I am developing a Pyramid 1.7 web app using Python 3.5, uWSGI 2.0.11 and SQLAlchemy 1.0.9. Seems like when using uWSGI with multiple workers we should use a uWSGI postfork function to connect to the Cassandra cluster ensuring each fork will use a…
Ander
  • 5,093
  • 7
  • 41
  • 70
1
vote
1 answer

Cassandra failed to create connection pool for new host

I am running a web app using the following components: Python 3.5.2 uWSGI 2.0.11.2 cassandra-driver 3.6.0 cassandra 3.7 With a Cassandra cluster (3 nodes): Node 1 - IP: 172.17.0.4 Node 2 - IP: 172.17.0.5 Node 3 - IP: 172.17.0.6 Using the…
Ander
  • 5,093
  • 7
  • 41
  • 70
1
vote
2 answers

How to implement token based pagination using cassandra python-driver?

Yes, iterate over Query is good thing, but i need paging results and send them with token to frontend. Can i create token for previous page too? How can i get and use ResponseFuture._paging_state in Models or Querysets. I search something like…
ubombi
  • 1,115
  • 2
  • 15
  • 30
0
votes
1 answer

Batch insert fails for table with a CQL map and nested UDT

I'm trying to write some data to cassandra, a connection is established and this is my database schema : CREATE TABLE IF NOT EXISTS road_traffic ( road_id INT, timestamp TIMESTAMP, radar_id INT, vehicles MAP
0
votes
1 answer

Can't connect to Astra DB with Python driver

I believe I'm doing exactly as mentioned in the documentation Python-driver-AstraDB cloud_config= { 'secure_connect_bundle': 'secure-connect-test-warehouse.zip' } logging.basicConfig(level=logging.DEBUG) auth_provider =…
0
votes
0 answers

Failing to insert total number of records in cassandra cluster from local why?

Full Data before exporting enter image description here Connection with cassandra enter image description here Exporting data enter image description here Loading Data enter image description here Failing to insert total number of records in the…