Skip to content

Timeseries not available when using cluster with asyncio #3083

Closed
@vukasin

Description

@vukasin

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.

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