-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Migrating commands to a mixin #1534
Conversation
This patterns allows for the reuse of these commands across connection types, including modules that are based on this client
Can the 'commands' class include only base redis commands, by separating sentinel and cluster commands into their own command classes? |
@barhsaul Great idea - I did that, after the 6.2.5 base docker upgrade. It still feels missing somehow given the parse_sentinel* helpers. Those might move as well 🤷 |
It looks like there are some great sentinel commands in #834 that we can also reference here. Once this is merged, I'd look at merging that in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me and should help compose clients that add additional commands. 👍
One day I'd like to figure out how to define the logic for core commands in one place that we can use for both redis-py and aioredis-py, but that's for another day.
Migrating commands to a mixin (redis/redis-py#1534) * Fixes #1136 * Added typing.py to store type annotations Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
This patterns allows for the reuse of these commands across connection types, including modules that are based on this client.
This doesn't break any APIs as evident by the lack of change in unit tests.
Pull Request check-list
Please make sure to review and check all of these items:
$ tox
pass with this change (including linting)?NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.
Description of change
Commands, and their associated helpers were moved from redis/client.py and added to redis/commands.py.