{"id":4424,"library":"apache-airflow-providers-redis","title":"Redis Provider for Apache Airflow","description":"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.","status":"active","version":"4.4.3","language":"en","source_language":"en","source_url":"https://github.com/apache/airflow/tree/main/airflow/providers/redis","tags":["airflow-provider","redis","data-pipeline","etl","orchestration","cache","message-broker"],"install":[{"cmd":"pip install apache-airflow-providers-redis","lang":"bash","label":"Install the Redis Provider"}],"dependencies":[{"reason":"Core Airflow functionality is required for provider integration.","package":"apache-airflow","optional":false},{"reason":"The underlying Python client library for interacting with Redis, often needed for direct hook usage.","package":"redis","optional":false}],"imports":[{"symbol":"RedisHook","correct":"from airflow.providers.redis.hooks.redis import RedisHook"},{"symbol":"RedisOperator","correct":"from airflow.providers.redis.operators.redis import RedisOperator"},{"symbol":"RedisKeySensor","correct":"from airflow.providers.redis.sensors.redis import RedisKeySensor"},{"symbol":"RedisPubSubSensor","correct":"from airflow.providers.redis.sensors.redis import RedisPubSubSensor"}],"quickstart":{"code":"from __future__ import annotations\n\nimport pendulum\n\nfrom airflow.models.dag import DAG\nfrom airflow.providers.redis.operators.redis import RedisOperator\n\nwith DAG(\n    dag_id=\"redis_example_dag\",\n    start_date=pendulum.datetime(2023, 1, 1, tz=\"UTC\"),\n    catchup=False,\n    schedule=None,\n    tags=[\"redis\", \"example\"],\n) as dag:\n    # Set a key-value pair in Redis using the default connection (redis_default)\n    set_value_task = RedisOperator(\n        task_id=\"set_my_key\",\n        command=\"SET my_key 'Hello from Airflow!'\",\n        redis_conn_id=\"redis_default\",\n    )\n\n    # Get the value of a key from Redis\n    get_value_task = RedisOperator(\n        task_id=\"get_my_key\",\n        command=\"GET my_key\",\n        redis_conn_id=\"redis_default\",\n    )\n    \n    # Increment a counter\n    increment_task = RedisOperator(\n        task_id=\"increment_counter\",\n        command=\"INCR counter\",\n        redis_conn_id=\"redis_default\",\n    )\n\n    set_value_task >> get_value_task >> increment_task","lang":"python","description":"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`)."},"warnings":[{"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.","message":"The `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.","severity":"breaking","affected_versions":"<4.4.3 (refer to provider changelog for specific version changes)"},{"fix":"Upgrade your Python environment to Python 3.10 or higher to be compatible with recent provider versions.","message":"Python 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.","severity":"breaking","affected_versions":">=4.1.1"},{"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`).","message":"When 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"The `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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}