internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: redis/redis-py

Issue:
Python 3.10 distutils Deprecation Warning
**Version**: Redis-py 4.0.1

**Platform**: Mac OS

**Description**: In Python 3.10 there is a deprecation warning: `DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives`, which is raised from using distutils in the Redis connection module: https://github.com/redis/redis-py/blob/master/redis/connection.py#L1. 

This breaks our test suite, and we can silence the warning for now, but perhaps it makes sense to migrate.



Discussion:

Resolving patch:
diff --git a/redis/connection.py b/redis/connection.py
--- a/redis/connection.py
+++ b/redis/connection.py
@@ -1,4 +1,4 @@
-from distutils.version import LooseVersion
+from packaging.version import Version
 from itertools import chain
 from time import time
 from queue import LifoQueue, Empty, Full
@@ -55,13 +55,13 @@
 if HIREDIS_AVAILABLE:
     import hiredis
 
-    hiredis_version = LooseVersion(hiredis.__version__)
+    hiredis_version = Version(hiredis.__version__)
     HIREDIS_SUPPORTS_CALLABLE_ERRORS = \
-        hiredis_version >= LooseVersion('0.1.3')
+        hiredis_version >= Version('0.1.3')
     HIREDIS_SUPPORTS_BYTE_BUFFER = \
-        hiredis_version >= LooseVersion('0.1.4')
+        hiredis_version >= Version('0.1.4')
     HIREDIS_SUPPORTS_ENCODING_ERRORS = \
-        hiredis_version >= LooseVersion('1.0.0')
+        hiredis_version >= Version('1.0.0')
 
     HIREDIS_USE_BYTE_BUFFER = True
     # only use byte buffer if hiredis supports it
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,8 @@
     author_email="oss@redis.com",
     python_requires=">=3.6",
     install_requires=[
-        'deprecated'
+        'deprecated==1.2.3',
+        'packaging==21.3',
     ],
     classifiers=[
         "Development Status :: 5 - Production/Stable",


Test patch:
Repository: redis/redis-py

Issue:
Add support for FT.AGGREGATE with LOAD *
redis-py should support recent changes to RediSearch. For reference, see the following:  RediSearch/RediSearch#2301


Discussion:
Default if LOAD is specified but no '*' will be to assume the '*'.

Resolving patch:
diff --git a/redis/commands/search/aggregation.py b/redis/commands/search/aggregation.py
--- a/redis/commands/search/aggregation.py
+++ b/redis/commands/search/aggregation.py
@@ -103,6 +103,7 @@ def __init__(self, query="*"):
         self._query = query
         self._aggregateplan = []
         self._loadfields = []
+        self._loadall = False
         self._limit = Limit()
         self._max = 0
         self._with_schema = False
@@ -116,9 +117,13 @@ def load(self, *fields):
 
         ### Parameters
 
-        - **fields**: One or more fields in the format of `@field`
+        - **fields**: If fields not specified, all the fields will be loaded.
+        Otherwise, fields should be given in the format of `@field`.
         """
-        self._loadfields.extend(fields)
+        if fields:
+            self._loadfields.extend(fields)
+        else:
+            self._loadall = True
         return self
 
     def group_by(self, fields, *reducers):
@@ -308,7 +313,10 @@ def build_args(self):
         if self._cursor:
             ret += self._cursor
 
-        if self._loadfields:
+        if self._loadall:
+            ret.append("LOAD")
+            ret.append("*")
+        elif self._loadfields:
             ret.append("LOAD")
             ret.append(str(len(self._loadfields)))
             ret.extend(self._loadfields)


Test patch:
diff --git a/tests/test_search.py b/tests/test_search.py
--- a/tests/test_search.py
+++ b/tests/test_search.py
@@ -1054,6 +1054,11 @@ def test_aggregations_load(client):
     res = client.ft().aggregate(req)
     assert res.rows[0] == ["t2", "world"]
 
+    # load all
+    req = aggregations.AggregateRequest("*").load()
+    res = client.ft().aggregate(req)
+    assert res.rows[0] == ["t1", "hello", "t2", "world"]
+
 
 @pytest.mark.redismod
 def test_aggregations_apply(client):
Repository: redis/redis-py

Issue:
obsolete redis.client.Script may be deleted
https://github.com/redis/redis-py/blob/64791a54f4b2c28b6a61920a23df9e1f614e6983/redis/client.py#L1868

has been moved to https://github.com/redis/redis-py/blob/64791a54f4b2c28b6a61920a23df9e1f614e6983/redis/commands/core.py#L3926 as part of #1534

Shouldn't the original file be removed to avoid duplication?


Discussion:

Resolving patch:
diff --git a/redis/client.py b/redis/client.py
--- a/redis/client.py
+++ b/redis/client.py
@@ -1,7 +1,6 @@
 from itertools import chain
 import copy
 import datetime
-import hashlib
 import re
 import threading
 import time
@@ -15,7 +14,6 @@
     ConnectionError,
     ExecAbortError,
     ModuleError,
-    NoScriptError,
     PubSubError,
     RedisError,
     ResponseError,
@@ -1896,37 +1894,3 @@ def watch(self, *names):
     def unwatch(self):
         "Unwatches all previously specified keys"
         return self.watching and self.execute_command('UNWATCH') or True
-
-
-class Script:
-    "An executable Lua script object returned by ``register_script``"
-
-    def __init__(self, registered_client, script):
-        self.registered_client = registered_client
-        self.script = script
-        # Precalculate and store the SHA1 hex digest of the script.
-
-        if isinstance(script, str):
-            # We need the encoding from the client in order to generate an
-            # accurate byte representation of the script
-            encoder = registered_client.connection_pool.get_encoder()
-            script = encoder.encode(script)
-        self.sha = hashlib.sha1(script).hexdigest()
-
-    def __call__(self, keys=[], args=[], client=None):
-        "Execute the script, passing any required ``args``"
-        if client is None:
-            client = self.registered_client
-        args = tuple(keys) + tuple(args)
-        # make sure the Redis server knows about the script
-        if isinstance(client, Pipeline):
-            # Make sure the pipeline can register the script before executing.
-            client.scripts.add(self)
-        try:
-            return client.evalsha(self.sha, len(keys), *args)
-        except NoScriptError:
-            # Maybe the client is pointed to a different server than the client
-            # that created this instance?
-            # Overwrite the sha just in case there was a discrepancy.
-            self.sha = client.script_load(self.script)
-            return client.evalsha(self.sha, len(keys), *args)


Test patch:
Repository: redis/redis-py

Issue:
exception in listen
```python
import time
import redis
db = redis.from_url('redis://redis_server', health_check_interval=1.0)
ps = db.pubsub(ignore_subscribe_messages=True)
ps.subscribe('CHANNEL_NOT_EXISTS')
time.sleep(2)
for msg in ps.listen():
    print(msg)
```
will raise exception:

```python
Traceback (most recent call last):
  File "test_listen.py", line 7, in <module>
    for msg in ps.listen():
  File ".../lib/python3.9/site-packages/redis/client.py", line 3605, in listen
    response = self.handle_message(self.parse_response(block=True))
  File ".../lib/python3.9/site-packages/redis/client.py", line 3635, in handle_message
    message_type = nativestr(response[0])
TypeError: 'NoneType' object is not subscriptable
```

`parse_response` returns None, since the first response is a health-check response.

Happens on 3.5.2 and 4.0.2

fix is straight forward:

```python
    def listen(self):
        "Listen for messages on channels this client has been subscribed to"
        while self.subscribed:
            response = self.parse_response(block=True)
            if response is None:
                continue
            response = self.handle_message(response)
            if response is not None:
                yield response
```



Discussion:

Resolving patch:
diff --git a/redis/client.py b/redis/client.py
--- a/redis/client.py
+++ b/redis/client.py
@@ -1530,6 +1530,8 @@ def handle_message(self, response, ignore_subscribe_messages=False):
         with a message handler, the handler is invoked instead of a parsed
         message being returned.
         """
+        if response is None:
+            return None
         message_type = str_if_bytes(response[0])
         if message_type == "pmessage":
             message = {


Test patch:
Repository: redis/redis-py

Issue:
Add support for BZMPOP



Discussion:

Resolving patch:
diff --git a/redis/commands/core.py b/redis/commands/core.py
--- a/redis/commands/core.py
+++ b/redis/commands/core.py
@@ -2,6 +2,7 @@
 import hashlib
 import time
 import warnings
+from typing import List, Optional
 
 from redis.exceptions import ConnectionError, DataError, NoScriptError, RedisError
 
@@ -3255,6 +3256,38 @@ def bzpopmin(self, keys, timeout=0):
         keys.append(timeout)
         return self.execute_command("BZPOPMIN", *keys)
 
+    def bzmpop(
+        self,
+        timeout: float,
+        numkeys: int,
+        keys: List[str],
+        min: Optional[bool] = False,
+        max: Optional[bool] = False,
+        count: Optional[int] = 1,
+    ) -> Optional[list]:
+        """
+        Pop ``count`` values (default 1) off of the first non-empty sorted set
+        named in the ``keys`` list.
+
+        If none of the sorted sets in ``keys`` has a value to pop,
+        then block for ``timeout`` seconds, or until a member gets added
+        to one of the sorted sets.
+
+        If timeout is 0, then block indefinitely.
+
+        For more information check https://redis.io/commands/bzmpop
+        """
+        args = [timeout, numkeys, *keys]
+        if (min and max) or (not min and not max):
+            raise DataError("Either min or max, but not both must be set")
+        elif min:
+            args.append("MIN")
+        else:
+            args.append("MAX")
+        args.extend(["COUNT", count])
+
+        return self.execute_command("BZMPOP", *args)
+
     def _zrange(
         self,
         command,


Test patch:
diff --git a/tests/test_commands.py b/tests/test_commands.py
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -2058,6 +2058,19 @@ def test_bzpopmin(self, r):
         r.zadd("c", {"c1": 100})
         assert r.bzpopmin("c", timeout=1) == (b"c", b"c1", 100)
 
+    @pytest.mark.onlynoncluster
+    # @skip_if_server_version_lt("7.0.0") turn on after redis 7 release
+    def test_bzmpop(self, unstable_r):
+        unstable_r.zadd("a", {"a1": 1, "a2": 2, "a3": 3})
+        res = [b"a", [[b"a1", b"1"], [b"a2", b"2"]]]
+        assert unstable_r.bzmpop(1, "2", ["b", "a"], min=True, count=2) == res
+        with pytest.raises(redis.DataError):
+            unstable_r.bzmpop(1, "2", ["b", "a"], count=2)
+        unstable_r.zadd("b", {"b1": 10, "ab": 9, "b3": 8})
+        res = [b"b", [[b"b1", b"10"]]]
+        assert unstable_r.bzmpop(0, "2", ["b", "a"], max=True) == res
+        assert unstable_r.bzmpop(1, "2", ["foo", "bar"], max=True) is None
+
     def test_zrange(self, r):
         r.zadd("a", {"a1": 1, "a2": 2, "a3": 3})
         assert r.zrange("a", 0, 1) == [b"a1", b"a2"]
Repository: redis/redis-py

Issue:
Add support for CLIENT NO-EVICT



Discussion:

Resolving patch:
diff --git a/redis/commands/core.py b/redis/commands/core.py
--- a/redis/commands/core.py
+++ b/redis/commands/core.py
@@ -639,6 +639,14 @@ def client_unpause(self, **kwargs):
         """
         return self.execute_command("CLIENT UNPAUSE", **kwargs)
 
+    def client_no_evict(self, mode: str) -> str:
+        """
+        Sets the client eviction mode for the current connection.
+
+        For more information check https://redis.io/commands/client-no-evict
+        """
+        return self.execute_command("CLIENT NO-EVICT", mode)
+
     def command(self, **kwargs):
         """
         Returns dict reply of details about all Redis commands.


Test patch:
diff --git a/tests/test_commands.py b/tests/test_commands.py
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -592,6 +592,13 @@ def test_client_pause_all(self, r, r2):
     def test_client_unpause(self, r):
         assert r.client_unpause() == b"OK"
 
+    @pytest.mark.onlynoncluster
+    # @skip_if_server_version_lt("7.0.0") turn on after redis 7 release
+    def test_client_no_evict(self, unstable_r):
+        assert unstable_r.client_no_evict("ON") == b"OK"
+        with pytest.raises(TypeError):
+            unstable_r.client_no_evict()
+
     @pytest.mark.onlynoncluster
     @skip_if_server_version_lt("3.2.0")
     def test_client_reply(self, r, r_timeout):
Repository: redis/redis-py

Issue:
Add support for ZINTERCARD



Discussion:

Resolving patch:
diff --git a/redis/commands/core.py b/redis/commands/core.py
--- a/redis/commands/core.py
+++ b/redis/commands/core.py
@@ -3153,6 +3153,19 @@ def zinterstore(self, dest, keys, aggregate=None):
         """
         return self._zaggregate("ZINTERSTORE", dest, keys, aggregate)
 
+    def zintercard(self, numkeys: int, keys: List[str], limit: int = 0) -> int:
+        """
+        Return the cardinality of the intersect of multiple sorted sets
+        specified by ``keys`.
+        When LIMIT provided (defaults to 0 and means unlimited), if the intersection
+        cardinality reaches limit partway through the computation, the algorithm will
+        exit and yield limit as the cardinality
+
+        For more information check https://redis.io/commands/zintercard
+        """
+        args = [numkeys, *keys, "LIMIT", limit]
+        return self.execute_command("ZINTERCARD", *args)
+
     def zlexcount(self, name, min, max):
         """
         Return the number of items in the sorted set ``name`` between the


Test patch:
diff --git a/tests/test_commands.py b/tests/test_commands.py
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -1979,6 +1979,15 @@ def test_zinter(self, r):
             (b"a1", 23),
         ]
 
+    @pytest.mark.onlynoncluster
+    # @skip_if_server_version_lt("7.0.0") turn on after redis 7 release
+    def test_zintercard(self, unstable_r):
+        unstable_r.zadd("a", {"a1": 1, "a2": 2, "a3": 1})
+        unstable_r.zadd("b", {"a1": 2, "a2": 2, "a3": 2})
+        unstable_r.zadd("c", {"a1": 6, "a3": 5, "a4": 4})
+        assert unstable_r.zintercard(3, ["a", "b", "c"]) == 2
+        assert unstable_r.zintercard(3, ["a", "b", "c"], limit=1) == 1
+
     @pytest.mark.onlynoncluster
     def test_zinterstore_sum(self, r):
         r.zadd("a", {"a1": 1, "a2": 1, "a3": 1})
Repository: redis/redis-py

Issue:
Add support for SORT_RO



Discussion:

Resolving patch:
diff --git a/redis/commands/core.py b/redis/commands/core.py
--- a/redis/commands/core.py
+++ b/redis/commands/core.py
@@ -2224,6 +2224,39 @@ def sort(
         options = {"groups": len(get) if groups else None}
         return self.execute_command("SORT", *pieces, **options)
 
+    def sort_ro(
+        self,
+        key: str,
+        start: Optional[int] = None,
+        num: Optional[int] = None,
+        by: Optional[str] = None,
+        get: Optional[List[str]] = None,
+        desc: bool = False,
+        alpha: bool = False,
+    ) -> list:
+        """
+        Returns the elements contained in the list, set or sorted set at key.
+        (read-only variant of the SORT command)
+
+        ``start`` and ``num`` allow for paging through the sorted data
+
+        ``by`` allows using an external key to weight and sort the items.
+            Use an "*" to indicate where in the key the item value is located
+
+        ``get`` allows for returning items from external keys rather than the
+            sorted data itself.  Use an "*" to indicate where in the key
+            the item value is located
+
+        ``desc`` allows for reversing the sort
+
+        ``alpha`` allows for sorting lexicographically rather than numerically
+
+        For more information check https://redis.io/commands/sort_ro
+        """
+        return self.sort(
+            key, start=start, num=num, by=by, get=get, desc=desc, alpha=alpha
+        )
+
 
 class ScanCommands:
     """


Test patch:
diff --git a/tests/test_commands.py b/tests/test_commands.py
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -2700,6 +2700,16 @@ def test_sort_all_options(self, r):
         assert num == 4
         assert r.lrange("sorted", 0, 10) == [b"vodka", b"milk", b"gin", b"apple juice"]
 
+    @skip_if_server_version_lt("7.0.0")
+    def test_sort_ro(self, r):
+        r["score:1"] = 8
+        r["score:2"] = 3
+        r["score:3"] = 5
+        r.rpush("a", "3", "2", "1")
+        assert r.sort_ro("a", by="score:*") == [b"2", b"3", b"1"]
+        r.rpush("b", "2", "3", "1")
+        assert r.sort_ro("b", desc=True) == [b"3", b"2", b"1"]
+
     def test_sort_issue_924(self, r):
         # Tests for issue https://github.com/andymccurdy/redis-py/issues/924
         r.execute_command("SADD", "issue#924", 1)
Repository: redis/redis-py

Issue:
Add support for SINTERCARD



Discussion:

Resolving patch:
diff --git a/redis/commands/core.py b/redis/commands/core.py
--- a/redis/commands/core.py
+++ b/redis/commands/core.py
@@ -2388,6 +2388,19 @@ def sinter(self, keys, *args):
         args = list_or_args(keys, args)
         return self.execute_command("SINTER", *args)
 
+    def sintercard(self, numkeys: int, keys: List[str], limit: int = 0) -> int:
+        """
+        Return the cardinality of the intersect of multiple sets specified by ``keys`.
+
+        When LIMIT provided (defaults to 0 and means unlimited), if the intersection
+        cardinality reaches limit partway through the computation, the algorithm will
+        exit and yield limit as the cardinality
+
+        For more information check https://redis.io/commands/sintercard
+        """
+        args = [numkeys, *keys, "LIMIT", limit]
+        return self.execute_command("SINTERCARD", *args)
+
     def sinterstore(self, dest, keys, *args):
         """
         Store the intersection of sets specified by ``keys`` into a new


Test patch:
diff --git a/tests/test_commands.py b/tests/test_commands.py
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -1748,6 +1748,15 @@ def test_sinter(self, r):
         r.sadd("b", "2", "3")
         assert r.sinter("a", "b") == {b"2", b"3"}
 
+    @pytest.mark.onlynoncluster
+    # @skip_if_server_version_lt("7.0.0") turn on after redis 7 release
+    def test_sintercard(self, unstable_r):
+        unstable_r.sadd("a", 1, 2, 3)
+        unstable_r.sadd("b", 1, 2, 3)
+        unstable_r.sadd("c", 1, 3, 4)
+        assert unstable_r.sintercard(3, ["a", "b", "c"]) == 2
+        assert unstable_r.sintercard(3, ["a", "b", "c"], limit=1) == 1
+
     @pytest.mark.onlynoncluster
     def test_sinterstore(self, r):
         r.sadd("a", "1", "2", "3")
Repository: redis/redis-py

Issue:
Add support for EXPIRETIME



Discussion:

Resolving patch:
diff --git a/redis/commands/core.py b/redis/commands/core.py
--- a/redis/commands/core.py
+++ b/redis/commands/core.py
@@ -1514,6 +1514,15 @@ def expireat(self, name: KeyT, when: AbsExpiryT) -> ResponseT:
             when = int(time.mktime(when.timetuple()))
         return self.execute_command("EXPIREAT", name, when)
 
+    def expiretime(self, key: str) -> int:
+        """
+        Returns the absolute Unix timestamp (since January 1, 1970) in seconds
+        at which the given key will expire.
+
+        For more information check https://redis.io/commands/expiretime
+        """
+        return self.execute_command("EXPIRETIME", key)
+
     def get(self, name: KeyT) -> ResponseT:
         """
         Return the value at key ``name``, or None if the key doesn't exist


Test patch:
diff --git a/tests/test_commands.py b/tests/test_commands.py
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -1075,6 +1075,12 @@ def test_expireat_unixtime(self, r):
         assert r.expireat("a", expire_at_seconds) is True
         assert 0 < r.ttl("a") <= 61
 
+    @skip_if_server_version_lt("7.0.0")
+    def test_expiretime(self, r):
+        r.set("a", "foo")
+        r.expireat("a", 33177117420)
+        assert r.expiretime("a") == 33177117420
+
     def test_get_and_set(self, r):
         # get and set can't be tested independently of each other
         assert r.get("a") is None
Repository: redis/redis-py

Issue:
Add support for PEXPIRETIME



Discussion:

Resolving patch:
diff --git a/redis/commands/core.py b/redis/commands/core.py
--- a/redis/commands/core.py
+++ b/redis/commands/core.py
@@ -1782,6 +1782,15 @@ def pexpireat(self, name: KeyT, when: AbsExpiryT) -> ResponseT:
             when = int(time.mktime(when.timetuple())) * 1000 + ms
         return self.execute_command("PEXPIREAT", name, when)
 
+    def pexpiretime(self, key: str) -> int:
+        """
+        Returns the absolute Unix timestamp (since January 1, 1970) in milliseconds
+        at which the given key will expire.
+
+        For more information check https://redis.io/commands/pexpiretime
+        """
+        return self.execute_command("PEXPIRETIME", key)
+
     def psetex(
         self,
         name: KeyT,


Test patch:
diff --git a/tests/test_commands.py b/tests/test_commands.py
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -1248,6 +1248,12 @@ def test_pexpireat_unixtime(self, r):
         assert r.pexpireat("a", expire_at_seconds) is True
         assert 0 < r.pttl("a") <= 61000
 
+    @skip_if_server_version_lt("7.0.0")
+    def test_pexpiretime(self, r):
+        r.set("a", "foo")
+        r.pexpireat("a", 33177117420000)
+        assert r.pexpiretime("a") == 33177117420000
+
     @skip_if_server_version_lt("2.6.0")
     def test_psetex(self, r):
         assert r.psetex("a", 1000, "value")
Repository: redis/redis-py

Issue:
Add support for EVAL RO



Discussion:

Resolving patch:
diff --git a/redis/commands/core.py b/redis/commands/core.py
--- a/redis/commands/core.py
+++ b/redis/commands/core.py
@@ -3881,7 +3881,12 @@ class ScriptCommands:
     https://redis.com/ebook/part-3-next-steps/chapter-11-scripting-redis-with-lua/
     """
 
-    def eval(self, script, numkeys, *keys_and_args):
+    def _eval(
+        self, command: str, script: str, numkeys: int, *keys_and_args: list
+    ) -> str:
+        return self.execute_command(command, script, numkeys, *keys_and_args)
+
+    def eval(self, script: str, numkeys: int, *keys_and_args: list) -> str:
         """
         Execute the Lua ``script``, specifying the ``numkeys`` the script
         will touch and the key names and argument values in ``keys_and_args``.
@@ -3892,7 +3897,19 @@ def eval(self, script, numkeys, *keys_and_args):
 
         For more information check  https://redis.io/commands/eval
         """
-        return self.execute_command("EVAL", script, numkeys, *keys_and_args)
+        return self._eval("EVAL", script, numkeys, *keys_and_args)
+
+    def eval_ro(self, script: str, numkeys: int, *keys_and_args: list) -> str:
+        """
+        The read-only variant of the EVAL command
+
+        Execute the read-only Lue ``script`` specifying the ``numkeys`` the script
+        will touch and the key names and argument values in ``keys_and_args``.
+        Returns the result of the script.
+
+        For more information check  https://redis.io/commands/eval_ro
+        """
+        return self._eval("EVAL_RO", script, numkeys, *keys_and_args)
 
     def evalsha(self, sha, numkeys, *keys_and_args):
         """


Test patch:
diff --git a/tests/test_scripting.py b/tests/test_scripting.py
--- a/tests/test_scripting.py
+++ b/tests/test_scripting.py
@@ -1,5 +1,6 @@
 import pytest
 
+import redis
 from redis import exceptions
 from tests.conftest import skip_if_server_version_lt
 
@@ -31,6 +32,13 @@ def test_eval(self, r):
         # 2 * 3 == 6
         assert r.eval(multiply_script, 1, "a", 3) == 6
 
+    # @skip_if_server_version_lt("7.0.0") turn on after redis 7 release
+    def test_eval_ro(self, unstable_r):
+        unstable_r.set("a", "b")
+        assert unstable_r.eval_ro("return redis.call('GET', KEYS[1])", 1, "a") == b"b"
+        with pytest.raises(redis.ResponseError):
+            unstable_r.eval_ro("return redis.call('DEL', KEYS[1])", 1, "a")
+
     @skip_if_server_version_lt("6.2.0")
     def test_script_flush_620(self, r):
         r.set("a", 2)