Skip to content

Commit

Permalink
Align docs and cross-slot test with recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-congo committed May 17, 2024
1 parent 9839381 commit ad5313f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
5 changes: 3 additions & 2 deletions python/python/glide/async_commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1543,10 +1543,11 @@ async def sunionstore(
"""
Stores the members of the union of all given sets specified by `keys` into a new set at `destination`.
When in cluster mode, all keys in `keys` and `destination` must map to the same hash slot.
See https://valkey.io/commands/sunionstore for more details.
Note:
When in cluster mode, all keys in `keys` and `destination` must map to the same hash slot.
Args:
destination (str): The key of the destination set.
keys (List[str]): The keys from which to retrieve the set members.
Expand Down
7 changes: 1 addition & 6 deletions python/python/tests/test_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1142,12 +1142,6 @@ async def test_sunionstore(self, redis_client: TRedisClient):
"g",
}

# same-slot requirement
if isinstance(redis_client, RedisClusterClient):
with pytest.raises(RequestError) as e:
await redis_client.sunionstore("abc", ["zxy", "lkn"])
assert "CrossSlot" in str(e)

@pytest.mark.parametrize("cluster_mode", [True, False])
@pytest.mark.parametrize("protocol", [ProtocolVersion.RESP2, ProtocolVersion.RESP3])
async def test_ltrim(self, redis_client: TRedisClient):
Expand Down Expand Up @@ -2941,6 +2935,7 @@ async def test_multi_key_command_returns_cross_slot_error(
redis_client.zrangestore("abc", "zxy", RangeByIndex(0, -1)),
redis_client.bzpopmin(["abc", "zxy", "lkn"], 0.5),
redis_client.bzpopmax(["abc", "zxy", "lkn"], 0.5),
redis_client.sunionstore("abc", ["zxy", "lkn"]),
]:
with pytest.raises(RequestError) as e:
await promise
Expand Down

0 comments on commit ad5313f

Please sign in to comment.