self.client.delete(*_keys)
    def yield_keys(self, *, prefix: Optional[str] = None) -> Iterator[str]:
        """Yield keys in the store."""
        if prefix:
            pattern = self._get_prefixed_key(prefix)
        else:
            pattern = self._get_prefixed_key("*")
        cursor, keys = self.client.scan(0, match=pattern)
        for key in keys:
            if self.namespace:
                relative_key = key[len(self.namespace) + 1 :]
                yield relative_key
            else:
                yield key
        while cursor != 0:
            cursor, keys = self.client.scan(cursor, match=pattern)
            for key in keys:
                if self.namespace:
                    relative_key = key[len(self.namespace) + 1 :]
                    yield relative_key
                else:
                    yield key
[docs]@deprecated("0.0.335", alternative="UpstashRedisByteStore")
class UpstashRedisStore(_UpstashRedisStore):
    """
    BaseStore implementation using Upstash Redis
    as the underlying store to store strings.
    Deprecated in favor of the more generic UpstashRedisByteStore.
    """
[docs]class UpstashRedisByteStore(ByteStore):
    """
    BaseStore implementation using Upstash Redis
    as the underlying store to store raw bytes.
    """
[docs]    def __init__(
        self,
        *,
        client: Any = None,
        url: Optional[str] = None,
        token: Optional[str] = None,
        ttl: Optional[int] = None,
        namespace: Optional[str] = None,
    ) -> None:
        self.underlying_store = _UpstashRedisStore(