Questions tagged [redis-py]

A Python interface to the Redis key-value store.

A Python interface to the Redis key-value store.

redis-py is developed and maintained by Andy McCurdy (sedrik@gmail.com).

It can be installed in your python environment using pip install redis or if you download the source from above link you can run python setup.py install

221 questions
0
votes
0 answers

redis-py connection refused

I have this code in Python: import redis r = redis.Redis(host="redis-db", password="foobared") r.get("some-key") But I got this error: Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/redis/connection.py", line…
pooooky
  • 490
  • 2
  • 12
0
votes
1 answer

Redis GETEX issue with python 'redis' library

I am using Python with VS code to connect to a AWS Redis Elasticache Cluster (6.2 which has GETEX). I am able to connect to the cluster fine and make a get call. I am also able to make a setex call in another method. However when I make a getex call…
Tejas
  • 43
  • 1
  • 5
0
votes
0 answers

How to update redis master object after failover process in redis-sentinel

I have a code which connects to sentinels and discovers redis master address. After discovering master we create redis master object and perform redis operations afterwards. The problem here is that after sentinel failover process the redis master…
rhoitjadhav
  • 691
  • 7
  • 16
0
votes
1 answer

How to use "mrange" function in Python module "redis-py"?

I'm trying to get used to the redis-py Python module. I just can't figure out how the "mrange" function has to be used to get one or more Time-Series by its labels. In the CLI it looks like this and it works: TS.MRANGE - + FILTER area_id=32 But I…
TarX-
  • 3
  • 2
0
votes
1 answer

(redis-py 4.3) redis.exceptions.ResponseError: WRONGTYPE Operation against a key holding the wrong kind of value

sismember throws error: r.sismember('somename/fooset', 'blah') Traceback (most recent call last): File "", line 1, in File "/myhome/lib/python3.9/site-packages/redis/commands/core.py", line 3251, in sismember return…
Xunny
  • 27
  • 5
0
votes
0 answers

Redis + Flask + Gunicorn

I was working on a redis caching implementation, There is some scenario where i need to flush the particular db, after flushing the db I'm unable to set and get from the redis. can any particular reason be there or any mistake in my approach ? I'm…
Surya R
  • 445
  • 2
  • 10
0
votes
0 answers

How to store and retrieve JSON data using Redis in Python

I want to store and retrieve large JSON data with Redis in python. Example If user search in grocery items and he typed 'abc'. I want retrieve all the records that contains 'abc' i.e. abc1, abc2 and abc3 etc. Objects that I want to store in Redis…
0
votes
0 answers

Getting ReadOnly error when writing data to AWS elastic cache while the cluster is vertically scaled

I have a python application that writes some data to AWS elastic cache cluster at a regular interval. Here's an example script that simulates the functionality of my application. It also replicates the error that I have been facing. from datetime…
0
votes
1 answer

How to handle an array of `4`s returned by redis-py `pipeline.execute()`?

I'm using redis-py to process bulk insertions into a Redis store. I wrote the following very simple method: import redis def push_metadata_to_redis(list_of_nested_dictionaries): redis_client = redis.Redis(host='localhost', port=6379, db=0) …
ciurlaro
  • 742
  • 10
  • 22
0
votes
1 answer

Get the name of every command issued to Redis

I need to add local proxy like twemproxy or dynomite infront of a remote Redis server. I want to compare the commands we use against the supported commands. We use redis indirectly so I cannot scan our code to determine which commands need support…
user319862
  • 1,797
  • 2
  • 24
  • 32
0
votes
1 answer

Issue during elements insertion in a set with py-redis

I have created a set using redis-py: r.sadd('Minutes', "00", "05", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55") When I display it, by: print(r.sscan('Minutes')[1]) I get an incomplete (shorter) list: ['25', '55', '50', '40', '20',…
Simone
  • 4,800
  • 12
  • 30
  • 46
0
votes
1 answer

Redis-py connection doesn't timeout

I have a very simple implementation on python using redis-py to interface with Redis. As part of the development, I am shutting redis down to simulate a timeout exception. Problem is that I am setting the timeout to a few seconds, but the connection…
Walucas
  • 2,549
  • 1
  • 21
  • 44
0
votes
2 answers

Channels_redis causing the error AttributeError: 'Redis' object has no attribute 'bzpopmin'

I am facing the following error message on my Django application: Exception inside application: 'Redis' object has no attribute 'bzpopmin' Traceback (most recent call last): File…
JackFurby
  • 51
  • 5
0
votes
1 answer

xadd not found with redis py 2.10.5

I am working with version 2.10.5 of redis-py and getting error "Redis object has no attribute xadd". Why am I getting this error?
user2757185
  • 91
  • 1
  • 1
  • 5
0
votes
1 answer

Python Redis Multiprocessing - redis.exceptions.ConnectionError -

I have written a program that does multiprocessing and does Scan, Get, and Set to Redis. The reason we went with Redis is to speed it up. Does anybody have any recommendations. I tried putting a retry loop around the get statements (and can do that…
NealWalters
  • 17,197
  • 42
  • 141
  • 251