-
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
Added GET argument to SET command #1412
Added GET argument to SET command #1412
Conversation
To handle this, the What do you think @andymccurdy |
This looks good. I'd like to wait to merge until Redis 6.2 is released so that we can include it in the unit tests. |
Hmm but it's not working now. There is no way to tell the difference between 'OK' (bool value) and 'OK' (string value, return when ''get'' param is set to True) in
this must be solve if we want to add 'get' argument to the set command. Will take a look tomorrow |
This should be pretty easy to solve. def set(self, ..., get=False):
options = {}
...
if get:
pieces.append(b'GET')
options['get'] = True
return self.execute_command(*pieces, **options) Then we make a response callback for def parse_set(response, **options):
if options.get('get'):
# return the string
# return the boolean |
haha allright. I will deal it in this way. I thought it should be more concise before, without passing any extra argument. will catch it up tomorrow. |
This looks good. Thanks! Tagging this as Redis 6.2 and will merge once the server is released. |
Thank you for your contribution @2014BDuck. I just merged, and validated with redis server 6.2.5. Approving, and merging into master. |
Added GET argument to SET command (redis/redis-py#1412) Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
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
Issue: #1411
Added GET argument to SET command, new in Redis 6.2: https://redis.io/commands/set