summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2018-11-13 16:44:36 -0800
committerAndy McCurdy <andy@andymccurdy.com>2018-11-13 16:44:36 -0800
commit36a84fc9ac4e06a9b85ccc4e4eda426b387c7093 (patch)
treeda94cf7658346e86eb212d507de9cbd4511b97d8 /benchmarks
parent90a52dd5de111f0053bb3ebaa7c78f73a82a1e3e (diff)
downloadredis-py-36a84fc9ac4e06a9b85ccc4e4eda426b387c7093.tar.gz
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.
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/base.py2
-rw-r--r--benchmarks/basic_operations.py2
2 files changed, 2 insertions, 2 deletions
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)