0

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 = redis.StrictRedis(host='localhost', port=6379, db=0)
r.pfadd("k", 2, 3, 4, 4, 5, 6, 7, 3, 4,)
  • Python version: 2
  • Pandas version: 0.19.0
  • Redis Version: 2.10.5`

Am I missing something here?

Augmented Jacob
  • 1,567
  • 19
  • 45

1 Answers1

1

Issue a r.execute_command("PFADD", "key", 1, 2, 3) to see if your server supports the command.

If this command runs ok, then the issue is with redis-py.

Edit

http://redis.io/commands/pfadd was added in Redis 2.8.9, your version is older than this.

You probably can do your stuff using http://redis.io/commands/sadd, which is supported in early versions. Check this link and try the set commands. They are slower in counting members, but are deterministic.

Community
  • 1
  • 1
Niloct
  • 9,491
  • 3
  • 44
  • 57