From 8486afb0ffc371cd33227f150bc5908fc5e928d7 Mon Sep 17 00:00:00 2001 From: Joshua Carp Date: Sat, 17 Nov 2018 02:38:39 -0500 Subject: [PATCH] [AIRFLOW-3353] Upgrade redis client (#4203) Now that Celery/Kombu have updated and work with RedisPy 3.x (they in fact force us to use 3.2) we should re-introduce this change. --- UPDATING.md | 8 ++++++++ airflow/contrib/hooks/redis_hook.py | 4 ++-- setup.py | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/UPDATING.md b/UPDATING.md index 8ee9385d315bb..f730ac1d86edc 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -24,6 +24,14 @@ assists users migrating to a new version. ## Airflow Master +### RedisPy dependency updated to v3 series + +If you are using the Redis Sensor or Hook you may have to update your code. See +[redis-py porting instructions] to check if your code might be affected (MSET, +MSETNX, ZADD, and ZINCRBY all were, but read the full doc). + +[redis-py porting instructions]: https://github.com/andymccurdy/redis-py/tree/3.2.0#upgrading-from-redis-py-2x-to-30 + ### New `dag_discovery_safe_mode` config option If `dag_discovery_safe_mode` is enabled, only check files for DAGs if diff --git a/airflow/contrib/hooks/redis_hook.py b/airflow/contrib/hooks/redis_hook.py index 6d864ed420fb1..a63c839e34c85 100644 --- a/airflow/contrib/hooks/redis_hook.py +++ b/airflow/contrib/hooks/redis_hook.py @@ -20,7 +20,7 @@ """ RedisHook module """ -from redis import StrictRedis +from redis import Redis from airflow.hooks.base_hook import BaseHook @@ -57,7 +57,7 @@ def get_conn(self): 'Initializing redis object for conn_id "%s" on %s:%s:%s', self.redis_conn_id, self.host, self.port, self.db ) - self.redis = StrictRedis( + self.redis = Redis( host=self.host, port=self.port, password=self.password, diff --git a/setup.py b/setup.py index 0b7aa7602e8ae..7f47012282112 100644 --- a/setup.py +++ b/setup.py @@ -213,7 +213,7 @@ def write_version(filename=os.path.join(*['airflow', postgres = ['psycopg2>=2.7.4'] qds = ['qds-sdk>=1.10.4'] rabbitmq = ['librabbitmq>=1.6.1'] -redis = ['redis>=2.10.5,<3.0.0'] +redis = ['redis~=3.2'] salesforce = ['simple-salesforce>=0.72'] samba = ['pysmbclient>=0.1.3'] segment = ['analytics-python>=1.2.9']