Skip to content

ZADD throws error with dict #771

@Akarshit

Description

@Akarshit

While trying to add elements to a zset, I get the following error stacktrace

Traceback (most recent call last):
  File "test.py", line 6, in <module>
    r.zadd("KEY", kwargs=dict)
  File "/Library/Python/2.7/site-packages/redis/client.py", line 2057, in zadd
    return self.execute_command('ZADD', name, *pieces)
  File "/Library/Python/2.7/site-packages/redis/client.py", line 573, in execute_command
    return self.parse_response(connection, command_name, **options)
  File "/Library/Python/2.7/site-packages/redis/client.py", line 585, in parse_response
    response = connection.read_response()
  File "/Library/Python/2.7/site-packages/redis/connection.py", line 582, in read_response
    raise response
redis.exceptions.ResponseError: value is not a valid float

The code I was trying to run was

import redis
r = redis.Redis(host='localhost', port=6379, db=2)

dict = {'akarshit': 1.1}
r.zadd("KEY", kwargs=dict)

Is there something I am missing or is this a bug with py-redis?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions