From 36a84fc9ac4e06a9b85ccc4e4eda426b387c7093 Mon Sep 17 00:00:00 2001 From: Andy McCurdy Date: Tue, 13 Nov 2018 16:44:36 -0800 Subject: remove legacy Redis class redis-py maintained backwards compatibility by keeping the old "Redis" class around for quite some time. While no doubt a convenience for folks who relied on it, the presence of both Redis and StrictRedis causes a number of support issues and general confusion. With 3.0, we're breaking a few things to make redis-py better going forward. This change removes the old Redis class. We also renamed the StrictRedis class to Redis and aliased StrictRedis to Redis. For people that have been using StrictRedis, this should not change anything. You can continue doing things as you are. People still using the legacy Redis class will need to update the argument order for the SETEX, LREM and ZADD commands. Additionally, the return values for TTL and PTTL now return the integer values -1 when a key exists but has no expire time and -2 when a key does not exist. Previously these cases returned a None value in the Redis class. --- benchmarks/base.py | 2 +- benchmarks/basic_operations.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'benchmarks') diff --git a/benchmarks/base.py b/benchmarks/base.py index a97001f..44e9341 100644 --- a/benchmarks/base.py +++ b/benchmarks/base.py @@ -21,7 +21,7 @@ class Benchmark(object): } defaults.update(kwargs) pool = redis.ConnectionPool(**kwargs) - self._client = redis.StrictRedis(connection_pool=pool) + self._client = redis.Redis(connection_pool=pool) return self._client def setup(self, **kwargs): diff --git a/benchmarks/basic_operations.py b/benchmarks/basic_operations.py index 34dcd97..a4b675d 100644 --- a/benchmarks/basic_operations.py +++ b/benchmarks/basic_operations.py @@ -31,7 +31,7 @@ def parse_args(): def run(): args = parse_args() - r = redis.StrictRedis() + r = redis.Redis() r.flushall() set_str(conn=r, num=args.n, pipeline_size=args.P, data_size=args.s) set_int(conn=r, num=args.n, pipeline_size=args.P, data_size=args.s) -- cgit v1.2.1