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

Python: adds HSTRLEN command #1564

Merged
merged 2 commits into from
Jun 18, 2024
Merged

Conversation

shohamazon
Copy link
Collaborator

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.

Copy link
Collaborator

@acarbonetto acarbonetto left a 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")
Copy link
Collaborator

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
Copy link
Collaborator

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

Copy link
Collaborator Author

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

@shohamazon shohamazon merged commit 0dde48b into valkey-io:main Jun 18, 2024
6 checks passed
@shohamazon shohamazon deleted the python/hstrlen branch June 18, 2024 07:44
acarbonetto pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 18, 2024
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 19, 2024
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants