Skip to content

Commit 111602c

Browse files
ashbAlice Berard
authored and
Alice Berard
committed
Revert "[AIRFLOW-3353] Upgrade redis client (apache#4203)" (apache#4205)
This reverts commit ae62987.
1 parent bc53ac6 commit 111602c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

airflow/contrib/hooks/redis_hook.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"""
2121
RedisHook module
2222
"""
23-
from redis import Redis
23+
from redis import StrictRedis
2424

2525
from airflow.exceptions import AirflowException
2626
from airflow.hooks.base_hook import BaseHook
@@ -69,7 +69,7 @@ def get_conn(self):
6969
self.redis_conn_id, self.host, self.port, self.db
7070
)
7171
try:
72-
self.client = Redis(
72+
self.client = StrictRedis(
7373
host=self.host,
7474
port=self.port,
7575
password=self.password,

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def write_version(filename=os.path.join(*['airflow',
218218
postgres = ['psycopg2-binary>=2.7.4']
219219
qds = ['qds-sdk>=1.9.6']
220220
rabbitmq = ['librabbitmq>=1.6.1']
221-
redis = ['redis>=3.0.0,<4.0.0']
221+
redis = ['redis>=2.10.5,<3.0.0']
222222
s3 = ['boto3>=1.7.0, <1.8.0']
223223
salesforce = ['simple-salesforce>=0.72']
224224
samba = ['pysmbclient>=0.1.3']

tests/contrib/hooks/test_redis_hook.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_get_conn(self):
3535
self.assertEqual(
3636
repr(hook.get_conn()),
3737
(
38-
'Redis<ConnectionPool'
38+
'StrictRedis<ConnectionPool'
3939
'<Connection<host=localhost,port=6379,db=0>>>'
4040
)
4141
)

tests/contrib/sensors/test_redis_sensor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_poke(self, key_exists):
5555
key_exists.return_value = False
5656
self.assertFalse(self.sensor.poke(None))
5757

58-
@patch("airflow.contrib.hooks.redis_hook.Redis.exists")
58+
@patch("airflow.contrib.hooks.redis_hook.StrictRedis.exists")
5959
def test_existing_key_called(self, redis_client_exists):
6060
self.sensor.run(
6161
start_date=DEFAULT_DATE,

0 commit comments

Comments
 (0)