r39132 closed pull request #4203: [AIRFLOW-3353] Upgrade redis client.
URL: https://github.com/apache/incubator-airflow/pull/4203
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/airflow/contrib/hooks/redis_hook.py
b/airflow/contrib/hooks/redis_hook.py
index 650cc9308b..cf684b862f 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.exceptions import AirflowException
from airflow.hooks.base_hook import BaseHook
@@ -69,7 +69,7 @@ def get_conn(self):
self.redis_conn_id, self.host, self.port, self.db
)
try:
- self.client = StrictRedis(
+ self.client = Redis(
host=self.host,
port=self.port,
password=self.password,
diff --git a/setup.py b/setup.py
index e651f5a66e..70adeb2b2e 100644
--- a/setup.py
+++ b/setup.py
@@ -218,7 +218,7 @@ def write_version(filename=os.path.join(*['airflow',
postgres = ['psycopg2-binary>=2.7.4']
qds = ['qds-sdk>=1.9.6']
rabbitmq = ['librabbitmq>=1.6.1']
-redis = ['redis>=2.10.5,<3.0.0']
+redis = ['redis>=3.0.0,<4.0.0']
s3 = ['boto3>=1.7.0, <1.8.0']
salesforce = ['simple-salesforce>=0.72']
samba = ['pysmbclient>=0.1.3']
diff --git a/tests/contrib/hooks/test_redis_hook.py
b/tests/contrib/hooks/test_redis_hook.py
index 12c30680e1..74d4b6c2e3 100644
--- a/tests/contrib/hooks/test_redis_hook.py
+++ b/tests/contrib/hooks/test_redis_hook.py
@@ -35,7 +35,7 @@ def test_get_conn(self):
self.assertEqual(
repr(hook.get_conn()),
(
- 'StrictRedis<ConnectionPool'
+ 'Redis<ConnectionPool'
'<Connection<host=localhost,port=6379,db=0>>>'
)
)
diff --git a/tests/contrib/sensors/test_redis_sensor.py
b/tests/contrib/sensors/test_redis_sensor.py
index 394c8e574b..95cbf67d13 100644
--- a/tests/contrib/sensors/test_redis_sensor.py
+++ b/tests/contrib/sensors/test_redis_sensor.py
@@ -55,7 +55,7 @@ def test_poke(self, key_exists):
key_exists.return_value = False
self.assertFalse(self.sensor.poke(None))
- @patch("airflow.contrib.hooks.redis_hook.StrictRedis.exists")
+ @patch("airflow.contrib.hooks.redis_hook.Redis.exists")
def test_existing_key_called(self, redis_client_exists):
self.sensor.run(
start_date=DEFAULT_DATE,
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services