Questions tagged [datastax-python-driver]

DataStax Python Driver for Apache Cassandra

A modern, feature-rich and highly-tunable Python client library for Apache Cassandra (2.1+) using exclusively Cassandra's binary protocol and Cassandra Query Language v3.

The driver supports Python 2.7, 3.3, 3.4, 3.5, and 3.6.

If you require compatibility with DataStax Enterprise, use the DataStax Enterprise Python Driver.

53 questions
1
vote
1 answer

DataStax Cassandra cassandra.cluster.NoHostAvailable

I am consistently getting this error under normal conditions. I am using the Python Cassandra driver (v3.11) to connect locally with RPC enabled. The issue presents itself after a period of time. y assumption was that it was related to max number of…
0
votes
1 answer

Use SSL self-signed certificate to connect to ScyllaDB (cassandra) node on Windows?

I've generated a self-signed cert using this scylla tutorial. Started a scylladb node, everything's fine and dandy. Now it's time to connect clients. Here's the script: from cassandra.cluster import Cluster ssl_options = dict( …
winwin
  • 958
  • 7
  • 25
0
votes
1 answer

How do I batch inserts with the Python driver?

I'm doing batch insert to db, now I'm facing with data types issue when inserting it as a batch into cassandra. Here I created a table named batch_rows , you can see type of node_id is text : (""" CREATE TABLE IF NOT EXISTS…
frankenstein
  • 125
  • 2
  • 11
0
votes
0 answers

How do I format "days from epoch" into a date in my Python Model?

I want the formatted date response from Cassandra Python Driver Model. Currently my response is { "fname": "First", "lname": "Last", "data_id": "a1c054e2-b393-11ed-9de9-001a7dda7115", "data_date": { "days_from_epoch": 19296 } } But, I…
0
votes
1 answer

How do I insert Date/Time/Datetime type of data in Cassandra through python ORM?

I have a table with primary keys all set, but I want to run query for data within a time range, so I add column date_query that store the same data as pk date from cassandra.cqlengine.columns import Text,Date,DateTime from cassandra.cqlengine.models…
HulkZZH
  • 1
  • 1
0
votes
0 answers

Cassandra partition key vs clustering key vs index vs second table

I'm trying to make an application using the Python driver for Cassandra in which I want to store car objects in the database. I've been reading a lot about Cassandra partition keys, clustering keys, indexes etc. but I can't figure out what would be…
Leander
  • 854
  • 4
  • 17
0
votes
1 answer

Why is the Cassandra Python driver not returning COUNT() of all rows?

I am inserting a df with around 14k rows in cassandra database of Data Stax. I am using the free version of Data Stax where you get 25 MB of storage limit. My dataset is around 1.5 MB of size. My code shows no error after insertion and fetching. But…
0
votes
1 answer

Inserting into a Cassandra DB is slow even with execute_concurrent()

I am trying to insert a pandas dataframe into cassandra. I am using the execute_concurrent, but I don't see any improvement. It is taking almost 5s per row insertions. There are 14k rows so at this rate it will take more than 15 hours. I have 12 GB…
0
votes
3 answers

Cassandra Python driver not fetching the next page of results

DataStax driver for Cassandra Version 3.25.0, Python version 3.9 Session.execute() fetches the first 100 records. As per the documentation, the driver is supposed to tranparently fetch next pages as we reach the end of first page. However, it…
Justin
  • 53
  • 1
  • 6
0
votes
1 answer

PySpark connecting to Cassandra using google colabs connection issue

I want to connect to cassandra using pyspark from google colabs. I have written the follwing code downloading the spark file and setting it to the path variable with java. The following is the code: !wget…
0
votes
0 answers

Connection issue python with Cassandra

I am trying to fetch data from Cassandra cluster. There is a issue it some time fetches few rows and some times no row. I am using Python 3.8.5 and latest DataStax Python driver. Below is the code from cassandra.cluster import Cluster from…
शेखर
  • 17,412
  • 13
  • 61
  • 117
0
votes
0 answers

Trying to create a keyspace on cassandra with datastax python driver

I have this weird error i can't seem to get around, the python error is something i cant seem to figure out, unresolvable contact point sounds like ip issue? cluster-ip is none when i look at the client below NAME↑ …
dedpo
  • 482
  • 11
  • 30
0
votes
1 answer

Batch inserting into multiple tables using DataStax model operations in Cassandra

Following DataStax's advice to 'use roughly one table per query pattern' as mentioned here, I have set up the same table twice, but keyed differently to optimize read times. -- This table supports queries that filter on specific first_ids and a…
aphrid
  • 589
  • 8
  • 25
0
votes
1 answer

Unable to Connect to Cassandra from Python code

I am not able to connect cassandra from python getting the below error Traceback (most recent call last): File "/app/script_max_device_count.py", line 232, in max_device_count.get_max_device_count_per_partner(partners_dict) File…
0
votes
1 answer

Cassandra write throttling with multiple clients

I have two clients (separate docker containers) both writing to a Cassandra cluster. The first is writing real-time data, which is ingested at a rate that the cluster can handle, albeit with little spare capacity. This is regarded as high-priority…
Ian Goldby
  • 5,609
  • 1
  • 45
  • 81