Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds support for new Redis v1.15 commands to the Upstash Redis Python package. The changes implement new hash field operations with expiration support, stream command extensions, connection library metadata setting, and expanded BITOP operations with XADD auto-sequence support for Redis 8+.
Changes:
- Added three new hash commands (HGETDEL, HGETEX, HSETEX) for atomic get-and-delete and field-level expiration
- Added two new stream commands (XACKDEL, XDELEX) for enhanced stream entry management
- Added CLIENT SETINFO command for setting client library metadata
- Extended BITOP command with four new operations (DIFF, DIFF1, ANDOR, ONE) for advanced bitmap operations
- Enhanced XADD documentation to describe auto-sequence number support (
<ms>-*format)
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| upstash_redis/commands.pyi | Added type hints for new commands in Commands, AsyncCommands, and PipelineCommands classes |
| upstash_redis/commands.py | Implemented new command methods with validation, documentation, and Redis protocol construction |
| tests/commands/bitmap/test_bitop.py | New comprehensive tests for extended BITOP operations |
| tests/commands/connection/test_client_setinfo.py | Tests for CLIENT SETINFO command with various attribute formats |
| tests/commands/hash/test_hgetdel.py | Tests for HGETDEL command including edge cases |
| tests/commands/hash/test_hgetex.py | Tests for HGETEX command with various expiration options |
| tests/commands/hash/test_hsetex.py | Tests for HSETEX command with expiration and conditional flags |
| tests/commands/stream/test_xackdel.py | Comprehensive tests for XACKDEL command with options |
| tests/commands/stream/test_xdelex.py | Tests for XDELEX command with various deletion behaviors |
| tests/commands/stream/test_xadd.py | New tests for XADD auto-sequence number functionality |
| tests/commands/asyncio/bitmap/test_bitop_async.py | Replaced old async bitmap tests with extended operation coverage |
| tests/commands/asyncio/bitmap/test_bitop.py | Removed old async test file |
| tests/commands/asyncio/connection/test_client_setinfo_async.py | Async tests for CLIENT SETINFO |
| tests/commands/asyncio/hash/test_hgetdel_async.py | Async tests for HGETDEL |
| tests/commands/asyncio/hash/test_hgetex_async.py | Async tests for HGETEX |
| tests/commands/asyncio/hash/test_hsetex_async.py | Async tests for HSETEX |
| tests/commands/asyncio/stream/test_xackdel_async.py | Async tests for XACKDEL |
| tests/commands/asyncio/stream/test_xdelex_async.py | Async tests for XDELEX |
| tests/commands/asyncio/stream/test_xadd.py | Updated with async auto-sequence tests |
Comments suppressed due to low confidence (1)
upstash_redis/commands.py:137
- The bitop implementation should convert the operation parameter to uppercase before validating and sending to Redis. Currently it passes the operation as-is, but the validation check on line 130 is case-sensitive ("NOT" vs "not"). This creates inconsistency since the tests expect case-insensitive operations to work. Add operation.upper() conversion before the validation checks and when building the command.
if len(keys) == 0:
raise Exception("At least one source key must be specified.")
if operation == "NOT" and len(keys) > 1:
raise Exception(
'The "NOT" operation takes only one source key as argument.'
)
command: List = ["BITOP", operation, destkey, *keys]
return self.execute(command)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CahidArda
reviewed
Jan 29, 2026
CahidArda
reviewed
Jan 29, 2026
CahidArda
approved these changes
Feb 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hash Commands
HGETDEL - Get and delete hash fields atomically
HGETEX - Get hash fields with expiration support
HSETEX - Set hash fields with expiration support
Stream Commands
XDELEX - Extended delete for streams
XACKDEL - Acknowledge and delete stream entries
Connection Commands
CLIENT SETINFO - Set client library name and version information
BITOP
Four new operations added:
BITOP DIFF - A bit is set only if it's set in all source bitmaps
BITOP DIFF1 - A bit is set if it's set in the first key but not in any of the other keys
BITOP ANDOR - A bit is set if it's set in X and also in one or more of Y1, Y2, ...
BITOP ONE - A bit is set if it's set in exactly one source key
XADD
Now supports auto sequence numbers via -* syntax