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: add BITPOS command #1604

Merged
merged 4 commits into from
Jun 19, 2024

Conversation

aaron-congo
Copy link
Collaborator

@aaron-congo aaron-congo commented Jun 19, 2024

Issue #, if available:
N/A

Description of changes:
https://redis.io/docs/latest/commands/bitpos/

  • Returns the position of the first bit matching the given bit value.
  • Policies: none (see here)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@aaron-congo aaron-congo requested a review from a team as a code owner June 19, 2024 00:37
@aaron-congo aaron-congo added the python Python wrapper label Jun 19, 2024
Comment on lines +4959 to +4960
# key exists, but it is not a string
with pytest.raises(RequestError):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reduce indentation for this check to move it outside of else block

@acarbonetto acarbonetto merged commit 7423404 into valkey-io:main Jun 19, 2024
6 checks passed
@acarbonetto acarbonetto deleted the python/integ_acongo_bitpos branch June 19, 2024 01:19
value of the string held at `key`.

Examples:
>>> await client.set("key1", "A12") # "A1" has binary value 01000001 00110001 00110010
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
>>> await client.set("key1", "A12") # "A1" has binary value 01000001 00110001 00110010
>>> await client.set("key1", "A12") # "A12" has binary value 01000001 00110001 00110010

cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 19, 2024
* wip

* Python: add BITPOS command

* Fix example

* Add test for invalid bit argument
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 24, 2024
* wip

* Python: add BITPOS command

* Fix example

* Add test for invalid bit argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Python wrapper
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants