Added GET argument to SET command#1412
Added GET argument to SET command#1412chayim merged 5 commits intoredis:masterfrom jiekun:2014BDuck/1411-set_command_argument
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 <[email protected]>
Pull Request check-list
Please make sure to review and check all of these items:
$ toxpass 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