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

RENAME should raise an error if the old key is missing #142

Open
xavdid opened this issue May 21, 2018 · 0 comments
Open

RENAME should raise an error if the old key is missing #142

xavdid opened this issue May 21, 2018 · 0 comments

Comments

@xavdid
Copy link

xavdid commented May 21, 2018

Per the docs, rename('a', 'b') should throw an error if 'a' doesn't exist. Currently, it's returning False:

def _rename(self, old_key, new_key, nx=False):
old_key = self._encode(old_key)
new_key = self._encode(new_key)
if old_key in self.redis and (not nx or new_key not in self.redis):
self.redis[new_key] = self.redis.pop(old_key)
return True
return False

Happy to try for a PR, though I'm not super familiar with python modules and it's probably an easy fix for someone more experienced

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

No branches or pull requests

1 participant