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
1 answer

How to make Redis dump.rdb save in directory when daemonized

So, I can get the directory of dump.rdb's location to change by using the dir option in redis.conf when I start it normally (just calling redis-server). If I want redis-server to run all of the time (I do) without needing a terminal window always…
jimmyq
  • 13
  • 5
0
votes
1 answer

Ignoring a function's return to save memory in Python

This might not even be an issue but I've got a couple of related Python questions that will hopefully help clear up a bit of debugging I've been stuck on for the past week or two. If you call a function that returns a large object, is there a way to…
Lucian Thorr
  • 1,997
  • 1
  • 21
  • 29
0
votes
1 answer

NameError: name 'redis' is not defined - PySpark - Redis

I am using the addPyFile method in pyspark to load the redis.zip file. I am able to load the file using sc.addPyFile("/home/path/to/redis.zip") But while running the code using ./pyspark, it is showing the error: NameError: name 'redis' is not…
vegeta
  • 13
  • 1
  • 7
0
votes
1 answer

Redis - Parse data stream provided by remote server

I have set up locally Redis and I want to connect to a remote server that provides a synthetic data stream in the form < ID, value >. I have so far managed to connect to the server mentioned above using sockets, read the data stream and just print…
Mewtwo
  • 1,231
  • 2
  • 18
  • 38
0
votes
1 answer

Storing python list of tuples in a redis sorted set where second element of tuple is used as score

I have a Python list of tuples like so: lst = [(22, -150.0), (23, -150.0), (18, -148.5), (15, -99.4), (5, -75.75), (4, -49.2), (13, -49.0), (9, -41.3), (20, -25.5), (17, -22.3), (10, -13.1), (16, -12.5), (14, -9.8), (3, -8.5), (1, -8.4), (12, -1.5),…
Hassan Baig
  • 15,055
  • 27
  • 102
  • 205
0
votes
1 answer

Trimming sorted set by score

In a Django app, I use redis to maintain a global sorted set where user ids are stored with the score of current time since epoch. After every 11 minutes, I am to run an asynchronous task that trims the sorted set to solely values that were saved…
Hassan Baig
  • 15,055
  • 27
  • 102
  • 205
0
votes
1 answer

Launching redis-server with the Latest Version

I've downloaded Redis 3.2.5 which has the functionality for PFADD and I intend on using it. Initially, I used to simply type redis-server in my root directory and it used to launch in the version 2.6.9. After a little searching, I found out that…
Augmented Jacob
  • 1,567
  • 19
  • 45
0
votes
1 answer

HyperLogLog Implementation on Redis Not Recognized

I'm trying to run a simple code here which simply inserts a value into a key using the PFADD operation but I get this error: ResponseError: unknown command 'PFADD' My code is as follows: import pandas as pd import redis r =…
Augmented Jacob
  • 1,567
  • 19
  • 45
0
votes
2 answers

redis get function return None

I am working on a flask application that interacts with redis. This applciation is deployed on heroku, with a redis add on. When I am doing some testing with the interaction, I am not able to get the key value pair that I just set. Instead, I always…
Jerry Zhang
  • 75
  • 4
  • 10
0
votes
0 answers

socket_timeout overriding BRPOP timeout param in StrictRedis

I'm running into an issue where a re-used StrictRedis connection with a socket_timeout parameter is overriding a brpop command with an unlimited timeout. Any ideas? redis_audience = StrictRedis(host=host, port=port, …
dizzyf
  • 3,263
  • 19
  • 29
0
votes
0 answers

Why is my Redis Python setup inserting values multiple times when a command is called once?

I'm trying out Redis and i'm not sure where i'm going wrong with my setup when r.lpush() is called I assume it would insert a value into my list and lengthen the list by one but when llen() is called the length increases by a random amount each time…
Jay Syko
  • 71
  • 2
  • 6
0
votes
1 answer

Implement a persistent stack data structure using Redis

I am implementing a stack data structure using redis-py and Redis list data type. I am not clear on how to handle the case when the corresponding list data type is empty. Default Redis behaviour appears to be that once a list is empty the related…
Waqas
  • 311
  • 1
  • 3
  • 10
0
votes
1 answer

Python None check (redis)

I am coding an module using redis-py, here I have a problem : def get_users_from_usergroup(usergroup): get_result = r_server.hmget('usergroups', usergroup) if get_result is not None: print('users from the given usegroup [' + usergroup + '] are…
Steeven_b
  • 747
  • 2
  • 10
  • 22
0
votes
1 answer

in python ,use redis-py with multiprocessing module , why each process is different fd?

in python ,use redis-py with multiprocessing module , why each process is different fd ? test code: # xiaorui.cc import time import multiprocessing import redis r = redis.Redis(host='127.0.0.1', port=6379, db=0) def func(msg): for i in…
rfyiamcool
  • 31
  • 1
  • 6
0
votes
0 answers

Bulk writing in Redis

I have to Insert millions of row of mysql Database into redis in python. I am currently using pipline for the same but It is talking too much time and memory. Can you suggest the better way to implement this.
keshaw
  • 1,215
  • 2
  • 10
  • 13
1 2 3
14
15