From d2c87ac97d4d3f58549378a8e097ccef08561608 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 27 Jun 2023 20:25:52 +0200 Subject: [PATCH] Bump redis to 4.6.0 (#10360) Closes: #10359 --- stubs/redis/METADATA.toml | 2 +- stubs/redis/redis/asyncio/client.pyi | 2 +- stubs/redis/redis/asyncio/connection.pyi | 8 ++------ stubs/redis/redis/asyncio/sentinel.pyi | 8 +++++--- stubs/redis/redis/client.pyi | 2 +- stubs/redis/redis/commands/core.pyi | 4 ++-- stubs/redis/redis/connection.pyi | 14 ++++++++------ stubs/redis/redis/sentinel.pyi | 4 ++-- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/stubs/redis/METADATA.toml b/stubs/redis/METADATA.toml index 423ba5838..81e550e9f 100644 --- a/stubs/redis/METADATA.toml +++ b/stubs/redis/METADATA.toml @@ -1,4 +1,4 @@ -version = "4.5.5" +version = "4.6.0" # Requires a version of cryptography with a `py.typed` file requires = ["cryptography>=35.0.0", "types-pyOpenSSL"] partial_stub = true diff --git a/stubs/redis/redis/asyncio/client.pyi b/stubs/redis/redis/asyncio/client.pyi index 575e833dd..451b7b7ee 100644 --- a/stubs/redis/redis/asyncio/client.pyi +++ b/stubs/redis/redis/asyncio/client.pyi @@ -827,7 +827,7 @@ class Pipeline(Redis[_StrType], Generic[_StrType]): withscores: bool = False, score_cast_func: Callable[[_StrType], Any] = ..., ) -> Any: ... - def zrank(self, name: _Key, value: _Value) -> Any: ... # type: ignore[override] + def zrank(self, name: _Key, value: _Value, withscore: bool = False) -> Any: ... # type: ignore[override] def zrem(self, name: _Key, *values: _Value) -> Any: ... # type: ignore[override] def zremrangebylex(self, name: _Key, min: _Value, max: _Value) -> Any: ... # type: ignore[override] def zremrangebyrank(self, name: _Key, min: int, max: int) -> Any: ... # type: ignore[override] diff --git a/stubs/redis/redis/asyncio/connection.pyi b/stubs/redis/redis/asyncio/connection.pyi index 09c9ebe1d..441a64a56 100644 --- a/stubs/redis/redis/asyncio/connection.pyi +++ b/stubs/redis/redis/asyncio/connection.pyi @@ -42,7 +42,6 @@ ExceptionMappingT: TypeAlias = Mapping[str, type[Exception] | Mapping[str, type[ class BaseParser: EXCEPTION_CLASSES: ExceptionMappingT def __init__(self, socket_read_size: int) -> None: ... - def __del__(self) -> None: ... @classmethod def parse_error(cls, response: str) -> ResponseError: ... def on_disconnect(self) -> None: ... @@ -81,8 +80,8 @@ class Connection: username: Any client_name: Any password: Any - socket_timeout: Any - socket_connect_timeout: Any + socket_timeout: float | None + socket_connect_timeout: float | None socket_keepalive: Any socket_keepalive_options: Any socket_type: Any @@ -122,7 +121,6 @@ class Connection: credential_provider: CredentialProvider | None = None, ) -> None: ... def repr_pieces(self): ... - def __del__(self) -> None: ... @property def is_connected(self): ... def register_connect_callback(self, callback) -> None: ... @@ -196,8 +194,6 @@ class UnixDomainSocketConnection(Connection): username: Any client_name: Any password: Any - socket_timeout: Any - socket_connect_timeout: Any retry_on_timeout: Any retry_on_error: list[type[RedisError]] retry: Any diff --git a/stubs/redis/redis/asyncio/sentinel.pyi b/stubs/redis/redis/asyncio/sentinel.pyi index 78adae9a2..dd9a92114 100644 --- a/stubs/redis/redis/asyncio/sentinel.pyi +++ b/stubs/redis/redis/asyncio/sentinel.pyi @@ -17,11 +17,13 @@ class SentinelManagedConnection(Connection): async def connect_to(self, address) -> None: ... async def connect(self): ... @overload # type: ignore[override] - async def read_response(self, *, timeout: float) -> Incomplete | None: ... + async def read_response(self, *, timeout: float, disconnect_on_error: bool = True) -> Incomplete | None: ... @overload - async def read_response(self, disable_decoding: bool, timeout: float) -> Incomplete | None: ... + async def read_response( + self, disable_decoding: bool, timeout: float, *, disconnect_on_error: bool = True + ) -> Incomplete | None: ... @overload - async def read_response(self, disable_decoding: bool = False, timeout: None = None): ... + async def read_response(self, disable_decoding: bool = False, timeout: None = None, *, disconnect_on_error: bool = True): ... class SentinelManagedSSLConnection(SentinelManagedConnection, SSLConnection): ... diff --git a/stubs/redis/redis/client.pyi b/stubs/redis/redis/client.pyi index e61515d02..b8079fa3d 100644 --- a/stubs/redis/redis/client.pyi +++ b/stubs/redis/redis/client.pyi @@ -681,7 +681,7 @@ class Pipeline(Redis[_StrType], Generic[_StrType]): withscores: bool = False, score_cast_func: Callable[[_StrType], Any] = ..., ) -> Pipeline[_StrType]: ... - def zrank(self, name: _Key, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override] + def zrank(self, name: _Key, value: _Value, withscore: bool = False) -> Pipeline[_StrType]: ... # type: ignore[override] def zrem(self, name: _Key, *values: _Value) -> Pipeline[_StrType]: ... # type: ignore[override] def zremrangebylex(self, name: _Key, min: _Value, max: _Value) -> Pipeline[_StrType]: ... # type: ignore[override] def zremrangebyrank(self, name: _Key, min: _Value, max: _Value) -> Pipeline[_StrType]: ... # type: ignore[override] diff --git a/stubs/redis/redis/commands/core.pyi b/stubs/redis/redis/commands/core.pyi index 9e31fd302..6aaf9d3a7 100644 --- a/stubs/redis/redis/commands/core.pyi +++ b/stubs/redis/redis/commands/core.pyi @@ -1178,7 +1178,7 @@ class SortedSetCommands(Generic[_StrType]): withscores: bool = False, score_cast_func: Callable[[_StrType], Any] = ..., ) -> list[_StrType]: ... - def zrank(self, name: _Key, value: _Value) -> int | None: ... + def zrank(self, name: _Key, value: _Value, withscore: bool = False) -> int | None: ... def zrem(self, name: _Key, *values: _Value) -> int: ... def zremrangebylex(self, name: _Key, min: _Value, max: _Value) -> int: ... def zremrangebyrank(self, name: _Key, min: int, max: int) -> int: ... @@ -1381,7 +1381,7 @@ class AsyncSortedSetCommands(Generic[_StrType]): withscores: bool = False, score_cast_func: Callable[[_StrType], Any] = ..., ) -> list[_StrType]: ... - async def zrank(self, name: _Key, value: _Value) -> int | None: ... + async def zrank(self, name: _Key, value: _Value, withscore: bool = False) -> int | None: ... async def zrem(self, name: _Key, *values: _Value) -> int: ... async def zremrangebylex(self, name: _Key, min: _Value, max: _Value) -> int: ... async def zremrangebyrank(self, name: _Key, min: int, max: int) -> int: ... diff --git a/stubs/redis/redis/connection.pyi b/stubs/redis/redis/connection.pyi index 8ede46969..5a8ae2195 100644 --- a/stubs/redis/redis/connection.pyi +++ b/stubs/redis/redis/connection.pyi @@ -89,6 +89,8 @@ class AbstractConnection: credential_provider: CredentialProvider | None password: str | None username: str | None + socket_timeout: float | None + socket_connect_timeout: float | None retry_on_timeout: bool retry_on_error: list[type[Exception]] retry: Retry @@ -101,6 +103,8 @@ class AbstractConnection: self, db: int = 0, password: str | None = None, + socket_timeout: float | None = None, + socket_connect_timeout: float | None = None, retry_on_timeout: bool = False, retry_on_error: list[type[Exception]] = ..., encoding: str = "utf-8", @@ -137,8 +141,6 @@ class AbstractConnection: class Connection(AbstractConnection): host: str port: int - socket_timeout: float | None - socket_connect_timeout: float | None socket_keepalive: bool socket_keepalive_options: Mapping[str, int | str] socket_type: int @@ -146,14 +148,14 @@ class Connection(AbstractConnection): self, host: str = "localhost", port: int = 6379, - socket_timeout: float | None = None, - socket_connect_timeout: float | None = None, socket_keepalive: bool = False, socket_keepalive_options: Mapping[str, int | str] | None = None, socket_type: int = 0, *, db: int = 0, password: str | None = None, + socket_timeout: float | None = None, + socket_connect_timeout: float | None = None, retry_on_timeout: bool = False, retry_on_error: list[type[Exception]] = ..., encoding: str = "utf-8", @@ -225,14 +227,14 @@ class SSLConnection(Connection): class UnixDomainSocketConnection(AbstractConnection): path: str - socket_timeout: float | None def __init__( self, path: str = "", - socket_timeout: float | None = None, *, db: int = 0, password: str | None = None, + socket_timeout: float | None = None, + socket_connect_timeout: float | None = None, retry_on_timeout: bool = False, retry_on_error: list[type[Exception]] = ..., encoding: str = "utf-8", diff --git a/stubs/redis/redis/sentinel.pyi b/stubs/redis/redis/sentinel.pyi index 133f58763..3b51430ce 100644 --- a/stubs/redis/redis/sentinel.pyi +++ b/stubs/redis/redis/sentinel.pyi @@ -16,11 +16,11 @@ class SlaveNotFoundError(ConnectionError): ... class SentinelManagedConnection(Connection): connection_pool: SentinelConnectionPool - def __init__(self, **kwargs) -> None: ... + def __init__(self, *, connection_pool: SentinelConnectionPool, **kwargs) -> None: ... def connect_to(self, address: _AddressAndPort) -> None: ... def connect(self) -> None: ... # The result can be either `str | bytes` or `list[str | bytes]` - def read_response(self, disable_decoding: bool = False) -> Any: ... # type: ignore[override] + def read_response(self, disable_decoding: bool = False, *, disconnect_on_error: bool = False) -> Any: ... class SentinelManagedSSLConnection(SentinelManagedConnection, SSLConnection): ...