Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeseries not available when using cluster with asyncio #3083

Closed
vukasin opened this issue Dec 20, 2023 · 1 comment
Closed

Timeseries not available when using cluster with asyncio #3083

vukasin opened this issue Dec 20, 2023 · 1 comment

Comments

@vukasin
Copy link

vukasin commented Dec 20, 2023

Version: 5.0.1

Redis Version: 7.2.2

Platform: Linux (bullseye)

Description: Timeseries commands are not visible when using ClusterConnection from redis.asyncio package. They are available when using ClusterConnection from redis. Here is the test code I am using to reproduce the issue:

import asyncio as aio
import redis as redis


def test_no_aio():
    conn = redis.RedisCluster(host="localhost", port=6379)
    print(conn.ts)


async def test_aio():
    conn = redis.asyncio.RedisCluster(host="localhost", port=6379)
    print(conn.ts)


if __name__ == "__main__":
    test_no_aio()
    aio.run(test_aio())

Output:

$ python test.py 
<bound method RedisModuleCommands.ts of <redis.cluster.RedisCluster object at 0x7ff427ce5eb0>>
Traceback (most recent call last):
  File "/workspaces/megadag/test.py", line 18, in <module>
    aio.run(test_aio())
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 664, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/workspaces/megadag/test.py", line 13, in test_aio
    print(conn.ts)
          ^^^^^^^
AttributeError: 'RedisCluster' object has no attribute 'ts'

Expected: Both version of the RedisCluster should provide access to the ts API.

@dvora-h
Copy link
Collaborator

dvora-h commented Feb 11, 2024

Fixed in #3115

@dvora-h dvora-h closed this as completed Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants