Registry / workflow / apache-airflow-providers-apache-cassandra

apache-airflow-providers-apache-cassandra

JSON →
library3.9.5pypypi✓ verified 85d ago

An Apache Airflow provider package that enables integration with Apache Cassandra, including hooks and operators to interact with Cassandra databases. Current version 3.9.4, released April 2026. Part of the Airflow providers ecosystem with monthly releases following Airflow's release cycle.

pip install apache-airflow-providers-apache-cassandra
INSTALL
IMPORT
SIG · APACHE-AIRFLOW-PRO
A
apache-airflow-providers-apache-cassandra
workflowpythonv3.9.5
Install
23.8s avg
Import
4673ms
Disk
275MB
Pass rate
6/ 10
Env Coverage6 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.9.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 25.5s
py 3.11
✕ build_error
✓ 25.4s
py 3.12
✕ build_error
✓ 19.3s
py 3.13
✕ build_error
✓ 19.5s
py 3.9
✓ —
✓ 29.4s
275MB installed
● package 275MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CassandraHook
from airflow.providers.apache.cassandra.hooks.cassandra import CassandraHook
from airflow.hooks.cassandra_hook import CassandraHook
Older Airflow versions used airflow.hooks, but providers require the new namespace.
CassandraTableRecordOperator
from airflow.providers.apache.cassandra.operators.cassandra import CassandraTableRecordOperator
from airflow.operators.cassandra_operator import CassandraTableRecordOperator
Operators moved to providers namespace.

Quick example demonstrating CassandraHook usage in a DAG.

from airflow import DAG from airflow.providers.apache.cassandra.hooks.cassandra import CassandraHook from datetime import datetime with DAG('cassandra_test', start_date=datetime(2024,1,1), schedule=None, catchup=False) as dag: def test_hook(): hook = CassandraHook(cassandra_conn_id='cassandra_default') session = hook.get_conn() rows = session.execute('SELECT * FROM system.peers') return list(rows) print(test_hook())
Debug
Known issues
breakingIn version 3.0.0, the module paths changed from `airflow.contrib.hooks.cassandra_hook` to `airflow.providers.apache.cassandra.hooks.cassandra`. Existing DAGs using the old import will break.
fix
Update imports to use the new provider path.
affects: <3.0.0 -> >=3.0.0
deprecatedSeveral operators like `CassandraTableRecordOperator` are deprecated in favor of plain Python operators with hooks. Check the changelog for details.
fix
Use `CassandraHook` directly within a PythonOperator.
affects: >=3.6.0
gotchaCassandra connection requires specifying `cluster` and `keyspace` in the Airflow connection UI or via environment variables. Missing these leads to cryptic errors.
fix
Ensure the connection is configured with proper host, port, keyspace, and optionally extra parameters.
affects: all
gotchaThe `cassandra-driver` library must be installed separately; it is not included automatically with the provider. Running without it causes ModuleNotFoundError.
fix
Install cassandra-driver: pip install cassandra-driver
affects: all
breakingStarting with provider version 2.0.0, Python 3.6 support was dropped. Users on older Python must upgrade.
fix
Upgrade to Python 3.7+ or stick with an older provider version.
affects: <2.0.0 -> >=2.0.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'airflow.providers.apache.cassandra'
Provider package not installed.
fix
Run: pip install apache-airflow-providers-apache-cassandra
cassandra.cluster.NoHostAvailable: ('Unable to connect to any servers', {'127.0.0.1:9042': 'Connection refused'})
Cassandra server is not running or connection details are incorrect.
fix
Start Cassandra server and verify host/port in Airflow connection 'cassandra_default'.
AttributeError: module 'airflow.hooks.cassandra_hook' has no attribute 'CassandraHook'
Using old import path from earlier Airflow versions.
fix
Change import to: from airflow.providers.apache.cassandra.hooks.cassandra import CassandraHook
Upgrade
Version history
3.9.5latest on PyPI · released Jun 7, 2026
Audit
Dependencies
apache-airflowrequiredCore Airflow dependency
cassandra-driverrequiredRequired for Cassandra connectivity
Agent activity
46 hits · last 30 days
node
38
OpenAI (training)
1
Resources
apache-airflow-providers-apache-cassandra — pip install apache-airflow-providers-apache-cassandra · libregistry