valkey-io / valkey-py

Valkey Python client based on a fork of redis-py
MIT License
46 stars 5 forks source link

hexpire exposed even though valkey doesn't support it. #78

Open NegatioN opened 2 weeks ago

NegatioN commented 2 weeks ago

Version: valkey-py: 6.0.0 (installed using pip install "valkey[libvalkey]") valkey: docker container valkey/valkey:8.0

Platform: Python 3.11.6 on Manjaro Linux

Description: Should hexpire be exposed as a command in Valkey-py if Valkey doesn't support it? Ideally hexpire is implemented, and everything is fine, but now it seems to be in a weird limbo state.

How to reproduce:

Run container: docker run -it --rm -p 6379:6379 --name valkey valkey/valkey:8.0

python:

import valkey
r = valkey.Valkey(host='localhost', port=6379, db=0)
event = {
     'air_quality': 256,
     'battery_level':89
 }
r.hset('yolo', mapping=event)
r.hexpire('yolo', 60, 'air_quality')
>>> ResponseError: unknown command 'HEXPIRE', with args beginning with: 'yolo' '60' 'FIELDS' '1' 'air_quality' 
aiven-sal commented 2 weeks ago

Hi! Thanks for the report! You are indeed absolutely right! That command should not be in Valkey-py. We can remove it in the next major version, for now I think we need to keep it (just in case). I'll drop it from the doc and keep this issue open as a reminder. Thanks again!