Registry /
workflow / apache-airflow-providers-apache-cassandra
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
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
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.fixUpdate 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.fixUse `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.fixEnsure 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.fixInstall 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.fixUpgrade 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.
fixRun: 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.
fixStart 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.
fixChange 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