Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Redis Cluster Support and Redis-py 4.1.0rc1 #1267

Closed
wants to merge 85 commits into from

Conversation

Andrew-Chen-Wang
Copy link
Collaborator

What do these changes do?

Includes Redis cluster support (for this first commit) up to commit redis/redis-py@9db1eec so far

Are there changes in behavior for the user?

Related issue number

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES/ folder
    • name it <issue_id>.<type> (e.g. 588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the PR
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example:
      Fix issue with non-ascii contents in doctest text files.

changing unit tests to account for defaults in redis flags redis/redis-py#1499

* This does not include the changes in tests/test_pubsub.py because we do not implement threading.

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
Add support for COPY command new in Redis 6.2 (redis/redis-py#1492)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
getex (redis/redis-py#1515)

* Removed small doc saying all time parameters can be datetime.timedelta. This is not needed with typing and can also be confusing with PXAT and EXAT

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
client_list (redis/redis-py#1517)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
hrandfield (redis/redis-py#1513)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
NOMKSTREAM support for XADD (redis/redis-py#1507)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
support for client unpause (redis/redis-py#1512)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
Implements CLIENT KILL laddr filter (redis/redis-py#1506)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
getdel (redis/redis-py#1514)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
zrandmember (redis/redis-py#1519)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
LT and GT support for ZADD (redis/redis-py#1509)

* The flags seem to be boolean, but I'm not sure why the test case has integers for test_zadd_gt_lt. Either way, I've set the annotation to be boolean only.

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
zrangestore (redis/redis-py#1521)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
zdiff and zdiffstore (redis/redis-py#1518)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
ensuring we adhere to exlusive options for getex (redis/redis-py#1531)

* Also fixed type annotation for name to be KeyT

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
Word was repeated in documentation (redis/redis-py#1532)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
zinter (redis/redis-py#1520)

* Made some adjustments to typing in _zaggregate

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
exclusive gt and lt in zadd (redis/redis-py#1533)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
fix getex flaky tests (redis/redis-py#1537)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
Updating base testing docker to redis 6.2.5 (redis/redis-py#1536)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
Add a count parameter to lpop/rpop for redis >= 6.2.0 (redis/redis-py#1487)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
add idle to xpending (redis/redis-py#1523)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
xautoclaim (redis/redis-py#1529)

* Note: @Andrew-Chen-Wang wanted to change nonnegative to non-negative, but either is acceptable: https://math.stackexchange.com/questions/3342643/nonnegative-vs-non-negative
* Fixed xpending_range type annotation
* Fixed grammar in xautoclaim

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
Fix some typos. (redis/redis-py#1496)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
Added GET argument to SET command (redis/redis-py#1412)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
implementing the LMOVE and BLMOVE commands (redis/redis-py#1504)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
MINID and LIMIT support for xtrim (redis/redis-py#1508)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
Adding support for CLIENT LIST with ID (redis/redis-py#1505)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
Zunion (redis/redis-py#1512)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
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>
Use Version instead of StrictVersion since distutils is deprecated. (redis/redis-py#1552)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
@Andrew-Chen-Wang Andrew-Chen-Wang marked this pull request as ready for review January 4, 2022 17:36
@Andrew-Chen-Wang Andrew-Chen-Wang changed the base branch from redis-update to master January 4, 2022 17:37
@lgtm-com
Copy link

lgtm-com bot commented Jan 4, 2022

This pull request introduces 2 alerts when merging c926746 into 817e9b0 - view on LGTM.com

new alerts:

  • 2 for Conflicting attributes in base classes

@lgtm-com
Copy link

lgtm-com bot commented Jan 4, 2022

This pull request introduces 8 alerts and fixes 4 when merging c926746 into 56d6b32 - view on LGTM.com

new alerts:

  • 4 for Conflicting attributes in base classes
  • 1 for Unused import
  • 1 for Missing call to `__init__` during object initialization
  • 1 for Modification of parameter with default
  • 1 for Module is imported with 'import' and 'import from'

fixed alerts:

  • 1 for Multiple calls to `__init__` during object initialization
  • 1 for Unused import
  • 1 for Missing call to `__init__` during object initialization
  • 1 for First argument to super() is not enclosing class

Comment on lines +19 to +20
def initialize(self, r):
self.commands = r.execute_command("COMMAND")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
def initialize(self, r):
self.commands = r.execute_command("COMMAND")
async def initialize(self, r):
self.commands = await r.execute_command("COMMAND")

@synodriver
Copy link

synodriver commented Mar 14, 2022

Wow, that's great. redis-py can also benefit from it.

@apekkar
Copy link

apekkar commented Nov 1, 2022

Any news regarding this? Is it going to be included? It's been pending over a year already?

We see this is a big lacking and hope that this would get included...

@Andrew-Chen-Wang
Copy link
Collaborator Author

@apekkar this is now included in redis-py itself. It's just not well-documented. Please use redis-py's async portion. Thanks!

@apekkar
Copy link

apekkar commented Nov 8, 2022

Ok thanks for information!

And sorry for stupid question: but you are saying we should use redis-py for clustered mode instead of this library? You are not planning to add a support for RedisCluster?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants