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 the getdel command available from redis 6.2.0 #1460

Closed
wants to merge 4 commits into from

Conversation

pcart-grandjean
Copy link

Pull Request check-list

Please make sure to review and check all of these items:

  • Does $ tox pass with this change (including linting)?
  • Does travis tests pass with this change (enable it first in your forked repo and wait for the travis build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

Coming with Redis 6.2 is the new command GETDEL. This pull request allows to also have it in this Python interface.

@pcart-grandjean
Copy link
Author

OK, I have been lazy: I deactivated the unit test that failed. Travis is OK, but of course Codecov is not happy. The thing is that I am not sure about this test_pubsub_worker_thread_exception_handler unit test. I will try and understand, but if you have some information that could help, I am really interested.

Copy link
Contributor

@jiekun jiekun left a comment

Choose a reason for hiding this comment

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

Hi! Thank you for your PR. I think the constant value should not be modified. WDYT

@@ -10,7 +10,7 @@
# redis 6 release candidates report a version number of 5.9.x. Use this
# constant for skip_if decorators as a placeholder until 6.0.0 is officially
# released
REDIS_6_VERSION = '5.9.0'
REDIS_6_VERSION = '6.2.0'
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not correct. REDIS_6_VERSION actually means "Since which version Redis6 feature introduced". Please check the following usage.
@skip_if_server_version_lt(REDIS_6_VERSION)

So you cannot change it to 6.2.0

Copy link
Author

Choose a reason for hiding this comment

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

You are right, this is a poor work around. The issue is that I do not understand why the tests are failing with Redis 6.2. All I want here is to add the getdel verb that is now available in Redis. I would appreciate a lot some help to resolve the Unit Test issues of that PR. If not I will cancel it and wait for somebody else to add getdel in another PR.

@@ -474,7 +474,7 @@ class TestPubSubSubcommands:
def test_pubsub_channels(self, r):
p = r.pubsub()
p.subscribe('foo', 'bar', 'baz', 'quux')
for i in range(4):
for _ in range(4):
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch! But personally speaking, I don't prefer irrelevant changes being included in this PR. What do you think @andymccurdy

Copy link
Author

Choose a reason for hiding this comment

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

I am very new contributing in open source project. So please forgive my silly question. Are you saying here that resolving this Pylint warning should not be done in this PR because it is not its main focus? I would have thought we should use every opportunity to reduce the technical debt, especially if it is clear that it will not break anything.

@chayim
Copy link
Contributor

chayim commented Sep 30, 2021

@pcart-grandjean Thank you for the contribution! There's some good news / bad news. The good news is that we have getdel support in master. But the bad news is that I hadn't seen this PR when that happened. My apologies. I'm going to close this PR as a result - and again, my apologies.

On the other hand, the smaller changes you were discussing earlier with @2014BDuck like this one we'd love to see in redis-py. Anything that improves quality is always welcome!

@chayim chayim closed this Sep 30, 2021
@pcart-grandjean
Copy link
Author

Hello I am very interested to use the redis 4 that includes the getdel. But when I install it with pip I only get version 3.5.3. If I want the getdel, I need to install the redis package from the sources. What's the plan to have a new version on Pypi?

@chayim
Copy link
Contributor

chayim commented Oct 3, 2021

@pcart-grandjean A new version of redis-py is coming in the near future! However, until then, will doing a pip install of master at a hash suffice?

pip install git+git://github.com/andymccurdy/redis-py.git@<the hash of your choice>

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.

3 participants