Registry / data / apache-airflow-providers-redis

apache-airflow-providers-redis

JSON →
library4.5.0pypypi✓ verified 24d ago

This is a provider package for Apache Airflow that enables seamless interaction with Redis. It offers hooks, operators, and sensors to integrate various Redis operations, such as setting/getting keys, publishing/subscribing to channels, and monitoring key events, directly into Airflow DAGs. The current version is 4.4.3, and Apache Airflow providers typically maintain an active release cadence, often aligning with Airflow core updates or independent feature/bug fixes.

pip install apache-airflow-providers-redis
INSTALL
IMPORT
SIG · APACHE-AIRFLOW-PRO
A
apache-airflow-providers-redis
datapythonv4.5.0
Install
24.5s avg
Import
5309ms
Disk
261MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.5.0 · 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
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 5.484s · 262.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 24.5s · import 5.134s · 260MB
261MB installed
● package 261MB
Code
Verified usage

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

RedisHook
from airflow.providers.redis.hooks.redis import RedisHook
RedisOperator
from airflow.providers.redis.operators.redis import RedisOperator
RedisKeySensor
from airflow.providers.redis.sensors.redis import RedisKeySensor
RedisPubSubSensor
from airflow.providers.redis.sensors.redis import RedisPubSubSensor

This DAG demonstrates how to use the `RedisOperator` to perform basic Redis commands like `SET`, `GET`, and `INCR`. It assumes you have an Airflow connection named `redis_default` configured in your Airflow UI or `airflow.cfg` that points to your Redis instance (e.g., Host: `localhost`, Port: `6379`, Connection Type: `Redis`).

from __future__ import annotations import pendulum from airflow.models.dag import DAG from airflow.providers.redis.operators.redis import RedisOperator with DAG( dag_id="redis_example_dag", start_date=pendulum.datetime(2023, 1, 1, tz="UTC"), catchup=False, schedule=None, tags=["redis", "example"], ) as dag: # Set a key-value pair in Redis using the default connection (redis_default) set_value_task = RedisOperator( task_id="set_my_key", command="SET my_key 'Hello from Airflow!'", redis_conn_id="redis_default", ) # Get the value of a key from Redis get_value_task = RedisOperator( task_id="get_my_key", command="GET my_key", redis_conn_id="redis_default", ) # Increment a counter increment_task = RedisOperator( task_id="increment_counter", command="INCR counter", redis_conn_id="redis_default", ) set_value_task >> get_value_task >> increment_task
Debug
Known issues
breakingThe `apache-airflow-providers-redis` package has increasing minimum Airflow version requirements. Version `4.4.3` requires `apache-airflow >=2.11.0`. Installing with an older Airflow version (<2.11.0) might trigger an automatic Airflow upgrade and necessitate a manual `airflow upgrade db` command.
fix
Ensure your Apache Airflow installation meets the minimum version requirement (`>=2.11.0` for provider version `4.4.3`). Review the provider's changelog for specific requirements for your desired provider version.
affects: <4.4.3 (refer to provider changelog for specific version changes)
breakingPython version support has changed. Provider version `4.1.1` dropped support for Python 3.9. Current provider version `4.4.3` requires Python `>=3.10`. Ensure your Python environment is compatible.
fix
Upgrade your Python environment to Python 3.10 or higher to be compatible with recent provider versions.
affects: >=4.1.1
gotchaWhen using `RedisHook.get_conn()` for direct Redis client interactions within Python tasks, the underlying `redis` Python client library must be explicitly installed in your Airflow environment (`pip install redis`). The provider package installs a dependency on `redis`, but for direct programmatic use, it's good practice to ensure it's available.
fix
Explicitly install the `redis` Python client library (`pip install redis`) in your Airflow environment. Also, verify that the installed `redis` client version is compatible with the provider's requirements (e.g., `>=4.5.2,!=4.5.5,!=5.0.2` for provider `4.4.3`).
affects: All versions
gotchaThe `RedisHook` and `RedisOperator` rely on Airflow connections (typically configured via the Airflow UI or `airflow.cfg`). The default connection ID is `redis_default`. Misconfigured connection parameters (host, port, password, DB, SSL settings) or a missing `redis_default` connection can lead to connection errors and task failures.
fix
Verify that an Airflow connection of type 'Redis' with the correct ID (e.g., `redis_default`) and valid credentials/parameters is set up in your Airflow environment.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'redis'
The 'redis' Python package is not installed in the environment where Airflow is running.
fix
Install the 'redis' package using pip: 'pip install redis'.
ImportError: cannot import name 'RedisHook' from 'airflow.providers.redis.hooks.redis'
The 'RedisHook' class has been moved or renamed in the 'apache-airflow-providers-redis' package.
fix
Update the import statement to: 'from airflow.providers.redis.hooks.redis_hook import RedisHook'.
AttributeError: module 'airflow.providers.redis.hooks.redis' has no attribute 'RedisHook'
The 'RedisHook' class is not found in the specified module, possibly due to changes in the package structure.
fix
Ensure you are importing 'RedisHook' from the correct module: 'from airflow.providers.redis.hooks.redis_hook import RedisHook'.
Broken DAG: [/path/to/dag.py] No module named 'airflow.providers.redis'
The 'apache-airflow-providers-redis' package is not installed in the Airflow environment.
fix
Install the 'apache-airflow-providers-redis' package using pip: 'pip install apache-airflow-providers-redis'.
ImportError: cannot import name 'RedisSensor' from 'airflow.providers.redis.sensors.redis'
The 'RedisSensor' class has been moved or renamed in the 'apache-airflow-providers-redis' package.
fix
Update the import statement to: 'from airflow.providers.redis.sensors.redis_key_sensor import RedisKeySensor'.
Upgrade
Version history
4.5.0latest on PyPI · released Jun 22, 2026
Audit
Dependencies
apache-airflowrequiredCore Airflow functionality is required for provider integration.
redisrequiredThe underlying Python client library for interacting with Redis, often needed for direct hook usage.
Agent activity
58 hits · last 30 days
node
48
OpenAI (training)
2
Resources