You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
❯ uv run python ./test.py
Traceback (most recent call last):
File "***/./test.py", line 19, in<module>asyncio.run(main())
~~~~~~~~~~~^^^^^^^^
File "/home/phi/.local/share/uv/python/cpython-3.13.2-linux-x86_64-gnu/lib/python3.13/asyncio/runners.py", line 195, in run
return runner.run(main)
~~~~~~~~~~^^^^^^
File "/home/phi/.local/share/uv/python/cpython-3.13.2-linux-x86_64-gnu/lib/python3.13/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/home/phi/.local/share/uv/python/cpython-3.13.2-linux-x86_64-gnu/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
returnfuture.result()
~~~~~~~~~~~~~^^
File "***/./test.py", line 15, in main
await client.set("key", "value", ex=SomeEnum.EX)
File "***/.venv/lib/python3.13/site-packages/redis/asyncio/client.py", line 616, in execute_command
return await conn.retry.call_with_retry(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<4 lines>...
)
^
File "***/.venv/lib/python3.13/site-packages/redis/asyncio/retry.py", line 59, in call_with_retry
return await do()
^^^^^^^^^^
File "***/.venv/lib/python3.13/site-packages/redis/asyncio/client.py", line 590, in _send_command_parse_response
return await self.parse_response(conn, command_name, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "***/.venv/lib/python3.13/site-packages/redis/asyncio/client.py", line 637, in parse_response
response = await connection.read_response()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "***/.venv/lib/python3.13/site-packages/redis/asyncio/connection.py", line 577, in read_response
raise response from None
redis.exceptions.ResponseError: value is not an integer or out of range
Expected behavior
IntEnum should also be available.
Additional information
❯ uv run python --version
Python 3.13.2
❯ uv pip list | grep redis
fakeredis 2.28.1
hiredis 3.1.0
redis 5.2.1
❯ docker ps -a | grep redis
34d11a926cc7 redis:7-bookworm "docker-entrypoint.s…" 4 minutes ago Up 4 minutes 0.0.0.0:6379->6379/tcp, [::]:6379->6379/tcp modest_wilson
❯ uname -r
5.15.167.4-microsoft-standard-WSL2
The text was updated successfully, but these errors were encountered:
Hi @phi-friday, it looks like you're trying to use the input without specifying a supported input type.
The ex parameter must be compatible with the following type hint: ExpiryT = Union[int, timedelta].
To fix this, simply set ex=SomeEnum.EX.value.
Hi @phi-friday, it looks like you're trying to use the input without specifying a supported input type. The ex parameter must be compatible with the following type hint: ExpiryT = Union[int, timedelta]. To fix this, simply set ex=SomeEnum.EX.value.
An instance of IntEnum is an instance of int, so there is no problem with type hint, but I understand the decision not to support subclasses of int.
Describe the bug
Cannot use IntEnum as ex value.
To reproduce
output:
Expected behavior
IntEnum should also be available.
Additional information
The text was updated successfully, but these errors were encountered: