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

Add support for JSON commands in Async Cluster #2600

Closed
baltika10 opened this issue Mar 1, 2023 · 1 comment · Fixed by #3115
Closed

Add support for JSON commands in Async Cluster #2600

baltika10 opened this issue Mar 1, 2023 · 1 comment · Fixed by #3115
Assignees

Comments

@baltika10
Copy link

Version: 4.5.1
Platform: Python 3.11 on Windows 11

from redis.asyncio.cluster import RedisCluster
client = RedisCluster()
await client.json().get("test")

raises AttributeError: 'RedisCluster' object has no attribute 'json'

Actually, it's a duplicate of #2234 which was closed without real solution

@kuza55
Copy link

kuza55 commented Jan 31, 2024

Hi,

This issue does not seem fully resolved, this code still crashes:

import asyncio
from redis.asyncio.cluster import RedisCluster  # type: ignore
import redis.asyncio as redis  # type: ignore

async def main():
    r = RedisCluster.from_url("redis://localhost:16379/0")
    p = r.pipeline()
    p.json().set("blah", ".", 1)
    await p.execute()
    print("done")

loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
asyncio.get_event_loop().run_until_complete(main())

I hacked up some changes that seem to make this pass, but it's obviously not what it should look like and I don't know if there are other situations that could be problematic: cf3bcdc

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

Successfully merging a pull request may close this issue.

3 participants