Rq: Fix Redis DeprecationWarning: Pipeline.hmset() is deprecated. Use Pipeline.hset() instead.

Created on 7 May 2020  路  10Comments  路  Source: rq/rq

rq.job and other places are triggering this warning from redis:

Pipeline.hmset() is deprecated. Use Pipeline.hset() instead.

This was deprecated in redis 3.5.0: https://github.com/andymccurdy/redis-py/blob/252c840ea2ade01637b4ed7c834dd83b130041b4/CHANGES#L17

Most helpful comment

For clarity, is this an issue or not?

On 1.4.2 I'm still getting a deprecation warning with redis v5.

Happy to create a PR.

All 10 comments

Mind opening a PR for this?

I don't have the time myself.

@bbayles I had to revert your PR in https://github.com/rq/rq/pull/1260 because it's causing crashes in deployments with Redis server < 4.0.

Alas! The docs aren't quite clear on what Redis server and redis-py versions are required/supported. Perhaps they could be updated to be more specific? Currently the front page says:

RQ requires Redis >= 3.0.0.

And requirements.txt says:

redis>=3.0

Is it a coincidence that the versions are the same?

For clarity, is this an issue or not?

On 1.4.2 I'm still getting a deprecation warning with redis v5.

Happy to create a PR.

+1

@tomhamiltonstubber yes it's still an issue since the previous PR is crashing deployments on Redis server < 4. @aparcar plans to work on a PR that adds Redis server version awareness to RQ. Hopefully we can get this patch in after this change.

What about this case here? https://github.com/rq/rq/blob/master/rq/job.py#L147 It uses hset directly instead of the compat function hmset? Just trying to understand the current setup

Was this page helpful?
0 / 5 - 0 ratings

Related issues

proofit404 picture proofit404  路  12Comments

canni picture canni  路  32Comments

untitaker picture untitaker  路  42Comments

sborpo picture sborpo  路  9Comments

arikfr picture arikfr  路  41Comments