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

Migrate from aioredis to redis-py with asyncio support #233

Merged
merged 3 commits into from
Aug 10, 2022

Conversation

moznuy
Copy link
Contributor

@moznuy moznuy commented May 4, 2022

The need of migration was expressed in #16
I don't know if I've missed anything important(tests pass).
There is also

await db.execute_command("JSON.SET", self.key(), ".", self.json())
and similar
args = ["ft.search", self.model.Meta.index_name, self.query, *self.pagination]
that could use direct api now, that is supported in redis.asyncio, I think, like:

import asyncio
import redis.asyncio as redis

async def main():
    print(await redis.StrictRedis().json().get("a"))

asyncio.run(main())

But that could be done in separate PR

@moznuy moznuy changed the title Migrate from aioredis to redis with asyncio support Migrate from aioredis to redis-py with asyncio support May 4, 2022
@moznuy
Copy link
Contributor Author

moznuy commented May 12, 2022

Any input will be appreciated

@moznuy moznuy force-pushed the feature/migrate_from_aioredis branch from caf2dca to f94b932 Compare May 13, 2022 12:02
@codecov-commenter
Copy link

codecov-commenter commented May 13, 2022

Codecov Report

Merging #233 (a80e37f) into main (e2ff503) will increase coverage by 0.21%.
The diff coverage is 83.33%.

@@            Coverage Diff             @@
##             main     #233      +/-   ##
==========================================
+ Coverage   77.25%   77.46%   +0.21%     
==========================================
  Files          12       12              
  Lines        1165     1154      -11     
==========================================
- Hits          900      894       -6     
+ Misses        265      260       -5     
Flag Coverage Δ
unit 77.46% <83.33%> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aredis_om/connections.py 70.00% <75.00%> (ø)
aredis_om/model/migrations/migrator.py 75.86% <75.00%> (ø)
aredis_om/_util.py 77.77% <77.77%> (ø)
aredis_om/__init__.py 100.00% <100.00%> (ø)
aredis_om/model/model.py 86.25% <100.00%> (-0.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2ff503...a80e37f. Read the comment docs.

@moznuy moznuy force-pushed the feature/migrate_from_aioredis branch from a80e37f to 4c5d8e2 Compare May 13, 2022 22:23
@moznuy moznuy force-pushed the feature/migrate_from_aioredis branch 2 times, most recently from b698a11 to 67a4185 Compare June 6, 2022 15:50
Add test for redis type
Fix imports from wrong module (for tests_sync)
@moznuy moznuy force-pushed the feature/migrate_from_aioredis branch from 67a4185 to 14f87bc Compare June 6, 2022 19:45
@moznuy moznuy mentioned this pull request Jun 13, 2022
@chayim chayim requested a review from dvora-h August 10, 2022 12:12
@dvora-h
Copy link
Contributor

dvora-h commented Aug 10, 2022

@moznuy Sorry that your PR waited so long but it's great and still relevant so I'm merging it now

@dvora-h dvora-h merged commit 4661459 into redis:main Aug 10, 2022
@ikornaselur ikornaselur mentioned this pull request Nov 21, 2022
8 tasks
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.

4 participants