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

fix: Adapt json_test to async_client #990

Merged
merged 1 commit into from
Mar 25, 2023
Merged

fix: Adapt json_test to async_client #990

merged 1 commit into from
Mar 25, 2023

Conversation

romange
Copy link
Collaborator

@romange romange commented Mar 25, 2023

No description provided.

@romange romange requested a review from adiholden March 25, 2023 09:48
Comment on lines +18 to +23
async def get_set_json(connection: aioredis.Redis, key, value, path="$"):
encoder = JSONEncoder()
await connection.execute_command("json.set", key, path, encoder.encode(value))
result = await connection.execute_command("json.get", key, path)
decoder = JSONDecoder()
return decoder.decode(result)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just use json.dumps and json.loads

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next time :)

@romange romange merged commit 3939da1 into main Mar 25, 2023
@romange romange deleted the Pr1 branch March 25, 2023 13:05
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 this pull request may close these issues.

2 participants