-
Notifications
You must be signed in to change notification settings - Fork 53
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
Python: adds HSTRLEN command #1564
Conversation
e7a4dd7
to
b7038b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit comment to address
@@ -838,7 +838,7 @@ async def hget(self, key: str, field: str) -> Optional[str]: | |||
Returns None if `field` is not presented in the hash or `key` does not exist. | |||
|
|||
Examples: | |||
>>> await client.hset("my_hash", "field") | |||
>>> await client.hset("my_hash", "field", "value") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
assert await redis_client.hset(key, {"field": "value"}) == 1 | ||
assert await redis_client.hstrlen(key, "field") == 5 | ||
|
||
assert await redis_client.hstrlen(key, "field2") == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why you have this test, since you're already testing the non-existing field case on line 873
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 873 is for non-existing key, I think it's nice to have both
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.