Add defaults for third-party stubs Q-T (#9959)

This commit is contained in:
Alex Waygood
2023-03-28 12:16:31 +01:00
committed by GitHub
parent 72456da2a3
commit b69b17c3d8
274 changed files with 3918 additions and 3735 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -36,43 +36,43 @@ class RedisCluster(AbstractRedis, AbstractRedisCluster, Generic[_StrType]): # T
result_callbacks: dict[str, Callable[[Incomplete, Incomplete], Incomplete]]
def __init__(
self,
host: str | None = ...,
port: str | int = ...,
host: str | None = None,
port: str | int = 6379,
# Cluster related kwargs
startup_nodes: list[ClusterNode] | None = ...,
require_full_coverage: bool = ...,
read_from_replicas: bool = ...,
reinitialize_steps: int = ...,
cluster_error_retry_attempts: int = ...,
connection_error_retry_attempts: int = ...,
max_connections: int = ...,
startup_nodes: list[ClusterNode] | None = None,
require_full_coverage: bool = True,
read_from_replicas: bool = False,
reinitialize_steps: int = 5,
cluster_error_retry_attempts: int = 3,
connection_error_retry_attempts: int = 3,
max_connections: int = 2147483648,
# Client related kwargs
db: str | int = ...,
path: str | None = ...,
credential_provider: CredentialProvider | None = ...,
username: str | None = ...,
password: str | None = ...,
client_name: str | None = ...,
db: str | int = 0,
path: str | None = None,
credential_provider: CredentialProvider | None = None,
username: str | None = None,
password: str | None = None,
client_name: str | None = None,
# Encoding related kwargs
encoding: str = ...,
encoding_errors: str = ...,
decode_responses: bool = ...,
encoding: str = "utf-8",
encoding_errors: str = "strict",
decode_responses: bool = False,
# Connection related kwargs
health_check_interval: float = ...,
socket_connect_timeout: float | None = ...,
socket_keepalive: bool = ...,
socket_keepalive_options: Mapping[int, int | bytes] | None = ...,
socket_timeout: float | None = ...,
retry: Retry | None = ...,
retry_on_error: list[Exception] | None = ...,
health_check_interval: float = 0,
socket_connect_timeout: float | None = None,
socket_keepalive: bool = False,
socket_keepalive_options: Mapping[int, int | bytes] | None = None,
socket_timeout: float | None = None,
retry: Retry | None = None,
retry_on_error: list[Exception] | None = None,
# SSL related kwargs
ssl: bool = ...,
ssl_ca_certs: str | None = ...,
ssl_ca_data: str | None = ...,
ssl_cert_reqs: str = ...,
ssl_certfile: str | None = ...,
ssl_check_hostname: bool = ...,
ssl_keyfile: str | None = ...,
ssl: bool = False,
ssl_ca_certs: str | None = None,
ssl_ca_data: str | None = None,
ssl_cert_reqs: str = "required",
ssl_certfile: str | None = None,
ssl_check_hostname: bool = False,
ssl_keyfile: str | None = None,
) -> None: ...
async def initialize(self) -> Self: ...
async def close(self) -> None: ...
@@ -89,14 +89,14 @@ class RedisCluster(AbstractRedis, AbstractRedisCluster, Generic[_StrType]): # T
def get_random_node(self) -> ClusterNode: ...
def get_default_node(self) -> ClusterNode: ...
def set_default_node(self, node: ClusterNode) -> None: ...
def get_node(self, host: str | None = ..., port: int | None = ..., node_name: str | None = ...) -> ClusterNode | None: ...
def get_node_from_key(self, key: str, replica: bool = ...) -> ClusterNode | None: ...
def get_node(self, host: str | None = None, port: int | None = None, node_name: str | None = None) -> ClusterNode | None: ...
def get_node_from_key(self, key: str, replica: bool = False) -> ClusterNode | None: ...
def keyslot(self, key: EncodableT) -> int: ...
def get_encoder(self) -> Encoder: ...
def get_connection_kwargs(self) -> dict[str, Any | None]: ...
def set_response_callback(self, command: str, callback: ResponseCallbackT) -> None: ...
async def execute_command(self, *args: EncodableT, **kwargs: Any) -> Any: ...
def pipeline(self, transaction: Any | None = ..., shard_hint: Any | None = ...) -> ClusterPipeline[_StrType]: ...
def pipeline(self, transaction: Any | None = None, shard_hint: Any | None = None) -> ClusterPipeline[_StrType]: ...
@classmethod
def from_url(cls, url: str, **kwargs) -> Self: ...
@@ -113,9 +113,9 @@ class ClusterNode:
self,
host: str,
port: str | int,
server_type: str | None = ...,
server_type: str | None = None,
*,
max_connections: int = ...,
max_connections: int = 2147483648,
connection_class: type[Connection] = ...,
**connection_kwargs: Any,
) -> None: ...
@@ -138,12 +138,12 @@ class NodesManager:
def __init__(
self, startup_nodes: list[ClusterNode], require_full_coverage: bool, connection_kwargs: dict[str, Any]
) -> None: ...
def get_node(self, host: str | None = ..., port: int | None = ..., node_name: str | None = ...) -> ClusterNode | None: ...
def set_nodes(self, old: dict[str, ClusterNode], new: dict[str, ClusterNode], remove_old: bool = ...) -> None: ...
def get_node_from_slot(self, slot: int, read_from_replicas: bool = ...) -> ClusterNode: ...
def get_node(self, host: str | None = None, port: int | None = None, node_name: str | None = None) -> ClusterNode | None: ...
def set_nodes(self, old: dict[str, ClusterNode], new: dict[str, ClusterNode], remove_old: bool = False) -> None: ...
def get_node_from_slot(self, slot: int, read_from_replicas: bool = False) -> ClusterNode: ...
def get_nodes_by_server_type(self, server_type: str) -> list[ClusterNode]: ...
async def initialize(self) -> None: ...
async def close(self, attr: str = ...) -> None: ...
async def close(self, attr: str = "nodes_cache") -> None: ...
class ClusterPipeline(AbstractRedis, AbstractRedisCluster, Generic[_StrType]): # TODO: AsyncRedisClusterCommands
def __init__(self, client: RedisCluster[_StrType]) -> None: ...
@@ -160,7 +160,7 @@ class ClusterPipeline(AbstractRedis, AbstractRedisCluster, Generic[_StrType]):
def __bool__(self) -> bool: ...
def __len__(self) -> int: ...
def execute_command(self, *args: KeyT | EncodableT, **kwargs: Any) -> Self: ...
async def execute(self, raise_on_error: bool = ..., allow_redirections: bool = ...) -> list[Any]: ...
async def execute(self, raise_on_error: bool = True, allow_redirections: bool = True) -> list[Any]: ...
def mset_nonatomic(self, mapping: Mapping[AnyKeyT, EncodableT]) -> Self: ...
class PipelineCommand:

View File

@@ -35,7 +35,7 @@ class Encoder:
decode_responses: Any
def __init__(self, encoding: str, encoding_errors: str, decode_responses: bool) -> None: ...
def encode(self, value: EncodableT) -> EncodedT: ...
def decode(self, value: EncodableT, force: bool = ...) -> EncodableT: ...
def decode(self, value: EncodableT, force: bool = False) -> EncodableT: ...
ExceptionMappingT: TypeAlias = Mapping[str, type[Exception] | Mapping[str, type[Exception]]]
@@ -46,21 +46,21 @@ class BaseParser:
def parse_error(self, response: str) -> ResponseError: ...
def on_disconnect(self) -> None: ...
def on_connect(self, connection: Connection): ...
async def read_response(self, disable_decoding: bool = ...) -> EncodableT | ResponseError | list[EncodableT] | None: ...
async def read_response(self, disable_decoding: bool = False) -> EncodableT | ResponseError | list[EncodableT] | None: ...
class PythonParser(BaseParser):
encoder: Any
def __init__(self, socket_read_size: int) -> None: ...
def on_connect(self, connection: Connection): ...
def on_disconnect(self) -> None: ...
async def read_response(self, disable_decoding: bool = ...) -> EncodableT | ResponseError | None: ...
async def read_response(self, disable_decoding: bool = False) -> EncodableT | ResponseError | None: ...
class HiredisParser(BaseParser):
def __init__(self, socket_read_size: int) -> None: ...
def on_connect(self, connection: Connection): ...
def on_disconnect(self) -> None: ...
async def read_from_socket(self) -> Literal[True]: ...
async def read_response(self, disable_decoding: bool = ...) -> EncodableT | list[EncodableT]: ...
async def read_response(self, disable_decoding: bool = False) -> EncodableT | list[EncodableT]: ...
DefaultParser: type[PythonParser | HiredisParser]
@@ -96,29 +96,29 @@ class Connection:
def __init__(
self,
*,
host: str = ...,
port: str | int = ...,
db: str | int = ...,
password: str | None = ...,
socket_timeout: float | None = ...,
socket_connect_timeout: float | None = ...,
socket_keepalive: bool = ...,
socket_keepalive_options: Mapping[int, int | bytes] | None = ...,
socket_type: int = ...,
retry_on_timeout: bool = ...,
host: str = "localhost",
port: str | int = 6379,
db: str | int = 0,
password: str | None = None,
socket_timeout: float | None = None,
socket_connect_timeout: float | None = None,
socket_keepalive: bool = False,
socket_keepalive_options: Mapping[int, int | bytes] | None = None,
socket_type: int = 0,
retry_on_timeout: bool = False,
retry_on_error: list[type[RedisError]] | _Sentinel = ...,
encoding: str = ...,
encoding_errors: str = ...,
decode_responses: bool = ...,
encoding: str = "utf-8",
encoding_errors: str = "strict",
decode_responses: bool = False,
parser_class: type[BaseParser] = ...,
socket_read_size: int = ...,
health_check_interval: float = ...,
client_name: str | None = ...,
username: str | None = ...,
retry: Retry | None = ...,
redis_connect_func: ConnectCallbackT | None = ...,
socket_read_size: int = 65536,
health_check_interval: float = 0,
client_name: str | None = None,
username: str | None = None,
retry: Retry | None = None,
redis_connect_func: ConnectCallbackT | None = None,
encoder_class: type[Encoder] = ...,
credential_provider: CredentialProvider | None = ...,
credential_provider: CredentialProvider | None = None,
) -> None: ...
def repr_pieces(self): ...
def __del__(self) -> None: ...
@@ -129,9 +129,9 @@ class Connection:
def set_parser(self, parser_class) -> None: ...
async def connect(self) -> None: ...
async def on_connect(self) -> None: ...
async def disconnect(self, nowait: bool = ...) -> None: ...
async def disconnect(self, nowait: bool = False) -> None: ...
async def check_health(self) -> None: ...
async def send_packed_command(self, command: bytes | str | Iterable[bytes], check_health: bool = ...): ...
async def send_packed_command(self, command: bytes | str | Iterable[bytes], check_health: bool = True): ...
async def send_command(self, *args, **kwargs) -> None: ...
@overload
async def read_response(self, *, timeout: float) -> Incomplete | None: ...
@@ -146,12 +146,12 @@ class SSLConnection(Connection):
ssl_context: Any
def __init__(
self,
ssl_keyfile: str | None = ...,
ssl_certfile: str | None = ...,
ssl_cert_reqs: str = ...,
ssl_ca_certs: str | None = ...,
ssl_ca_data: str | None = ...,
ssl_check_hostname: bool = ...,
ssl_keyfile: str | None = None,
ssl_certfile: str | None = None,
ssl_cert_reqs: str = "required",
ssl_ca_certs: str | None = None,
ssl_ca_data: str | None = None,
ssl_check_hostname: bool = False,
**kwargs,
) -> None: ...
@property
@@ -177,12 +177,12 @@ class RedisSSLContext:
context: Any
def __init__(
self,
keyfile: str | None = ...,
certfile: str | None = ...,
cert_reqs: str | None = ...,
ca_certs: str | None = ...,
ca_data: str | None = ...,
check_hostname: bool = ...,
keyfile: str | None = None,
certfile: str | None = None,
cert_reqs: str | None = None,
ca_certs: str | None = None,
ca_data: str | None = None,
check_hostname: bool = False,
) -> None: ...
def get(self) -> ssl.SSLContext: ...
@@ -205,24 +205,24 @@ class UnixDomainSocketConnection(Connection):
def __init__(
self,
*,
path: str = ...,
db: str | int = ...,
username: str | None = ...,
password: str | None = ...,
socket_timeout: float | None = ...,
socket_connect_timeout: float | None = ...,
encoding: str = ...,
encoding_errors: str = ...,
decode_responses: bool = ...,
retry_on_timeout: bool = ...,
path: str = "",
db: str | int = 0,
username: str | None = None,
password: str | None = None,
socket_timeout: float | None = None,
socket_connect_timeout: float | None = None,
encoding: str = "utf-8",
encoding_errors: str = "strict",
decode_responses: bool = False,
retry_on_timeout: bool = False,
retry_on_error: list[type[RedisError]] | _Sentinel = ...,
parser_class: type[BaseParser] = ...,
socket_read_size: int = ...,
health_check_interval: float = ...,
client_name: str | None = ...,
retry: Retry | None = ...,
redis_connect_func: ConnectCallbackT | None = ...,
credential_provider: CredentialProvider | None = ...,
socket_read_size: int = 65536,
health_check_interval: float = 0.0,
client_name: str | None = None,
retry: Retry | None = None,
redis_connect_func: ConnectCallbackT | None = None,
credential_provider: CredentialProvider | None = None,
) -> None: ...
def repr_pieces(self) -> Iterable[tuple[str, str | int]]: ...
@@ -251,7 +251,7 @@ class ConnectionPool:
max_connections: Any
encoder_class: Any
def __init__(
self, connection_class: type[Connection] = ..., max_connections: int | None = ..., **connection_kwargs
self, connection_class: type[Connection] = ..., max_connections: int | None = None, **connection_kwargs
) -> None: ...
pid: Any
def reset(self) -> None: ...
@@ -260,15 +260,15 @@ class ConnectionPool:
def make_connection(self): ...
async def release(self, connection: Connection): ...
def owns_connection(self, connection: Connection): ...
async def disconnect(self, inuse_connections: bool = ...): ...
async def disconnect(self, inuse_connections: bool = True): ...
class BlockingConnectionPool(ConnectionPool):
queue_class: Any
timeout: Any
def __init__(
self,
max_connections: int = ...,
timeout: int | None = ...,
max_connections: int = 50,
timeout: int | None = 20,
connection_class: type[Connection] = ...,
queue_class: type[asyncio.Queue[Any]] = ...,
**connection_kwargs,
@@ -279,4 +279,4 @@ class BlockingConnectionPool(ConnectionPool):
def make_connection(self): ...
async def get_connection(self, command_name, *keys, **options): ...
async def release(self, connection: Connection): ...
async def disconnect(self, inuse_connections: bool = ...): ...
async def disconnect(self, inuse_connections: bool = True): ...

View File

@@ -26,11 +26,11 @@ class Lock:
self,
redis: Redis[Any],
name: str | bytes | memoryview,
timeout: float | None = ...,
sleep: float = ...,
blocking: bool = ...,
blocking_timeout: float | None = ...,
thread_local: bool = ...,
timeout: float | None = None,
sleep: float = 0.1,
blocking: bool = True,
blocking_timeout: float | None = None,
thread_local: bool = True,
) -> None: ...
def register_scripts(self) -> None: ...
async def __aenter__(self) -> Self: ...
@@ -38,14 +38,14 @@ class Lock:
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...
async def acquire(
self, blocking: bool | None = ..., blocking_timeout: float | None = ..., token: str | bytes | None = ...
self, blocking: bool | None = None, blocking_timeout: float | None = None, token: str | bytes | None = None
) -> bool: ...
async def do_acquire(self, token: str | bytes) -> bool: ...
async def locked(self) -> bool: ...
async def owned(self) -> bool: ...
def release(self) -> Awaitable[None]: ...
async def do_release(self, expected_token: bytes) -> None: ...
def extend(self, additional_time: float, replace_ttl: bool = ...) -> Awaitable[bool]: ...
def extend(self, additional_time: float, replace_ttl: bool = False) -> Awaitable[bool]: ...
async def do_extend(self, additional_time: float, replace_ttl: bool) -> bool: ...
def reacquire(self) -> Awaitable[bool]: ...
async def do_reacquire(self) -> bool: ...

View File

@@ -5,5 +5,5 @@ from typing import Any
# from redis.asyncio.cluster import ClusterNode
class CommandsParser:
async def initialize(self, node: Incomplete | None = ...) -> None: ... # TODO: ClusterNode
async def initialize(self, node: Incomplete | None = None) -> None: ... # TODO: ClusterNode
async def get_keys(self, *args: Any) -> tuple[str, ...] | None: ...

View File

@@ -44,7 +44,7 @@ class Sentinel(AsyncSentinelCommands):
min_other_sentinels: Any
connection_kwargs: Any
def __init__(
self, sentinels, min_other_sentinels: int = ..., sentinel_kwargs: Incomplete | None = ..., **connection_kwargs
self, sentinels, min_other_sentinels: int = 0, sentinel_kwargs: Incomplete | None = None, **connection_kwargs
) -> None: ...
async def execute_command(self, *args, **kwargs): ...
def check_master_state(self, state: dict[Any, Any], service_name: str) -> bool: ...

View File

@@ -13,17 +13,17 @@ class NoBackoff(ConstantBackoff):
def __init__(self) -> None: ...
class ExponentialBackoff(AbstractBackoff):
def __init__(self, cap: float = ..., base: float = ...) -> None: ...
def __init__(self, cap: float = 0.512, base: float = 0.008) -> None: ...
def compute(self, failures: int) -> float: ...
class FullJitterBackoff(AbstractBackoff):
def __init__(self, cap: float = ..., base: float = ...) -> None: ...
def __init__(self, cap: float = 0.512, base: float = 0.008) -> None: ...
def compute(self, failures: int) -> float: ...
class EqualJitterBackoff(AbstractBackoff):
def __init__(self, cap: float = ..., base: float = ...) -> None: ...
def __init__(self, cap: float = 0.512, base: float = 0.008) -> None: ...
def compute(self, failures: int) -> float: ...
class DecorrelatedJitterBackoff(AbstractBackoff):
def __init__(self, cap: float = ..., base: float = ...) -> None: ...
def __init__(self, cap: float = 0.512, base: float = 0.008) -> None: ...
def compute(self, failures: int) -> float: ...

View File

@@ -38,7 +38,7 @@ class CaseInsensitiveDict(dict[_StrType, _VT]):
def __init__(self, data: SupportsItems[_StrType, _VT]) -> None: ...
def update(self, data: SupportsItems[_StrType, _VT]) -> None: ... # type: ignore[override]
@overload
def get(self, k: _StrType, default: None = ...) -> _VT | None: ...
def get(self, k: _StrType, default: None = None) -> _VT | None: ...
@overload
def get(self, k: _StrType, default: _VT | _T) -> _VT | _T: ...
# Overrides many other methods too, but without changing signature
@@ -57,7 +57,7 @@ def parse_sentinel_master(response): ...
def parse_sentinel_masters(response): ...
def parse_sentinel_slaves_and_sentinels(response): ...
def parse_sentinel_get_master(response): ...
def pairs_to_dict(response, decode_keys: bool = ..., decode_string_values: bool = ...): ...
def pairs_to_dict(response, decode_keys: bool = False, decode_string_values: bool = False): ...
def pairs_to_dict_typed(response, type_info): ...
def zset_score_pairs(response, **options): ...
def sort_return_tuples(response, **options): ...
@@ -131,7 +131,7 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands[_StrType], Sentinel
encoding_errors: str = ...,
charset: str | None = ...,
errors: str | None = ...,
decode_responses: Literal[False] = ...,
decode_responses: Literal[False] = False,
retry_on_timeout: bool = ...,
ssl: bool = ...,
ssl_keyfile: str | None = ...,
@@ -165,126 +165,126 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands[_StrType], Sentinel
charset: str | None,
errors: str | None,
decode_responses: Literal[True],
retry_on_timeout: bool = ...,
retry_on_error: list[type[RedisError]] | None = ...,
ssl: bool = ...,
ssl_keyfile: str | None = ...,
ssl_certfile: str | None = ...,
ssl_cert_reqs: str | int | None = ...,
ssl_ca_certs: str | None = ...,
ssl_ca_path: Incomplete | None = ...,
ssl_ca_data: Incomplete | None = ...,
ssl_check_hostname: bool = ...,
ssl_password: Incomplete | None = ...,
ssl_validate_ocsp: bool = ...,
ssl_validate_ocsp_stapled: bool = ..., # added in 4.1.1
ssl_ocsp_context: Incomplete | None = ..., # added in 4.1.1
ssl_ocsp_expected_cert: Incomplete | None = ..., # added in 4.1.1
max_connections: int | None = ...,
single_connection_client: bool = ...,
health_check_interval: float = ...,
client_name: str | None = ...,
username: str | None = ...,
retry: Retry | None = ...,
redis_connect_func: _ConnectFunc | None = ...,
credential_provider: CredentialProvider | None = ...,
retry_on_timeout: bool = False,
retry_on_error: list[type[RedisError]] | None = None,
ssl: bool = False,
ssl_keyfile: str | None = None,
ssl_certfile: str | None = None,
ssl_cert_reqs: str | int | None = "required",
ssl_ca_certs: str | None = None,
ssl_ca_path: Incomplete | None = None,
ssl_ca_data: Incomplete | None = None,
ssl_check_hostname: bool = False,
ssl_password: Incomplete | None = None,
ssl_validate_ocsp: bool = False,
ssl_validate_ocsp_stapled: bool = False, # added in 4.1.1
ssl_ocsp_context: Incomplete | None = None, # added in 4.1.1
ssl_ocsp_expected_cert: Incomplete | None = None, # added in 4.1.1
max_connections: int | None = None,
single_connection_client: bool = False,
health_check_interval: float = 0,
client_name: str | None = None,
username: str | None = None,
retry: Retry | None = None,
redis_connect_func: _ConnectFunc | None = None,
credential_provider: CredentialProvider | None = None,
) -> None: ...
@overload
def __init__(
self: Redis[str],
host: str = ...,
port: int = ...,
db: int = ...,
password: str | None = ...,
socket_timeout: float | None = ...,
socket_connect_timeout: float | None = ...,
socket_keepalive: bool | None = ...,
socket_keepalive_options: Mapping[str, int | str] | None = ...,
connection_pool: ConnectionPool | None = ...,
unix_socket_path: str | None = ...,
encoding: str = ...,
encoding_errors: str = ...,
charset: str | None = ...,
errors: str | None = ...,
host: str = "localhost",
port: int = 6379,
db: int = 0,
password: str | None = None,
socket_timeout: float | None = None,
socket_connect_timeout: float | None = None,
socket_keepalive: bool | None = None,
socket_keepalive_options: Mapping[str, int | str] | None = None,
connection_pool: ConnectionPool | None = None,
unix_socket_path: str | None = None,
encoding: str = "utf-8",
encoding_errors: str = "strict",
charset: str | None = None,
errors: str | None = None,
*,
decode_responses: Literal[True],
retry_on_timeout: bool = ...,
ssl: bool = ...,
ssl_keyfile: str | None = ...,
ssl_certfile: str | None = ...,
ssl_cert_reqs: str | int | None = ...,
ssl_ca_certs: str | None = ...,
ssl_ca_data: Incomplete | None = ...,
ssl_check_hostname: bool = ...,
ssl_password: Incomplete | None = ...,
ssl_validate_ocsp: bool = ...,
ssl_validate_ocsp_stapled: bool = ..., # added in 4.1.1
ssl_ocsp_context: Incomplete | None = ..., # added in 4.1.1
ssl_ocsp_expected_cert: Incomplete | None = ..., # added in 4.1.1
max_connections: int | None = ...,
single_connection_client: bool = ...,
health_check_interval: float = ...,
client_name: str | None = ...,
username: str | None = ...,
retry: Retry | None = ...,
redis_connect_func: _ConnectFunc | None = ...,
credential_provider: CredentialProvider | None = ...,
retry_on_timeout: bool = False,
ssl: bool = False,
ssl_keyfile: str | None = None,
ssl_certfile: str | None = None,
ssl_cert_reqs: str | int | None = "required",
ssl_ca_certs: str | None = None,
ssl_ca_data: Incomplete | None = None,
ssl_check_hostname: bool = False,
ssl_password: Incomplete | None = None,
ssl_validate_ocsp: bool = False,
ssl_validate_ocsp_stapled: bool = False, # added in 4.1.1
ssl_ocsp_context: Incomplete | None = None, # added in 4.1.1
ssl_ocsp_expected_cert: Incomplete | None = None, # added in 4.1.1
max_connections: int | None = None,
single_connection_client: bool = False,
health_check_interval: float = 0,
client_name: str | None = None,
username: str | None = None,
retry: Retry | None = None,
redis_connect_func: _ConnectFunc | None = None,
credential_provider: CredentialProvider | None = None,
) -> None: ...
@overload
def __init__(
self: Redis[bytes],
host: str = ...,
port: int = ...,
db: int = ...,
password: str | None = ...,
socket_timeout: float | None = ...,
socket_connect_timeout: float | None = ...,
socket_keepalive: bool | None = ...,
socket_keepalive_options: Mapping[str, int | str] | None = ...,
connection_pool: ConnectionPool | None = ...,
unix_socket_path: str | None = ...,
encoding: str = ...,
encoding_errors: str = ...,
charset: str | None = ...,
errors: str | None = ...,
decode_responses: Literal[False] = ...,
retry_on_timeout: bool = ...,
ssl: bool = ...,
ssl_keyfile: str | None = ...,
ssl_certfile: str | None = ...,
ssl_cert_reqs: str | int | None = ...,
ssl_ca_certs: str | None = ...,
ssl_ca_data: Incomplete | None = ...,
ssl_check_hostname: bool = ...,
ssl_password: Incomplete | None = ...,
ssl_validate_ocsp: bool = ...,
ssl_validate_ocsp_stapled: bool = ..., # added in 4.1.1
ssl_ocsp_context: Incomplete | None = ..., # added in 4.1.1
ssl_ocsp_expected_cert: Incomplete | None = ..., # added in 4.1.1
max_connections: int | None = ...,
single_connection_client: bool = ...,
health_check_interval: float = ...,
client_name: str | None = ...,
username: str | None = ...,
retry: Retry | None = ...,
redis_connect_func: _ConnectFunc | None = ...,
credential_provider: CredentialProvider | None = ...,
host: str = "localhost",
port: int = 6379,
db: int = 0,
password: str | None = None,
socket_timeout: float | None = None,
socket_connect_timeout: float | None = None,
socket_keepalive: bool | None = None,
socket_keepalive_options: Mapping[str, int | str] | None = None,
connection_pool: ConnectionPool | None = None,
unix_socket_path: str | None = None,
encoding: str = "utf-8",
encoding_errors: str = "strict",
charset: str | None = None,
errors: str | None = None,
decode_responses: Literal[False] = False,
retry_on_timeout: bool = False,
ssl: bool = False,
ssl_keyfile: str | None = None,
ssl_certfile: str | None = None,
ssl_cert_reqs: str | int | None = "required",
ssl_ca_certs: str | None = None,
ssl_ca_data: Incomplete | None = None,
ssl_check_hostname: bool = False,
ssl_password: Incomplete | None = None,
ssl_validate_ocsp: bool = False,
ssl_validate_ocsp_stapled: bool = False, # added in 4.1.1
ssl_ocsp_context: Incomplete | None = None, # added in 4.1.1
ssl_ocsp_expected_cert: Incomplete | None = None, # added in 4.1.1
max_connections: int | None = None,
single_connection_client: bool = False,
health_check_interval: float = 0,
client_name: str | None = None,
username: str | None = None,
retry: Retry | None = None,
redis_connect_func: _ConnectFunc | None = None,
credential_provider: CredentialProvider | None = None,
) -> None: ...
def get_encoder(self): ...
def get_connection_kwargs(self): ...
def set_response_callback(self, command, callback): ...
def pipeline(self, transaction: bool = ..., shard_hint: Any = ...) -> Pipeline[_StrType]: ...
def pipeline(self, transaction: bool = True, shard_hint: Any = None) -> Pipeline[_StrType]: ...
def transaction(self, func, *watches, **kwargs): ...
@overload
def lock(
self,
name: _Key,
timeout: float | None = ...,
sleep: float = ...,
blocking: bool = ...,
blocking_timeout: float | None = ...,
lock_class: None = ...,
thread_local: bool = ...,
timeout: float | None = None,
sleep: float = 0.1,
blocking: bool = True,
blocking_timeout: float | None = None,
lock_class: None = None,
thread_local: bool = True,
) -> Lock: ...
@overload
def lock(
@@ -295,19 +295,19 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands[_StrType], Sentinel
blocking: bool,
blocking_timeout: float | None,
lock_class: type[_LockType],
thread_local: bool = ...,
thread_local: bool = True,
) -> _LockType: ...
@overload
def lock(
self,
name: _Key,
timeout: float | None = ...,
sleep: float = ...,
blocking: bool = ...,
blocking_timeout: float | None = ...,
timeout: float | None = None,
sleep: float = 0.1,
blocking: bool = True,
blocking_timeout: float | None = None,
*,
lock_class: type[_LockType],
thread_local: bool = ...,
thread_local: bool = True,
) -> _LockType: ...
def pubsub(self, *, shard_hint: Any = ..., ignore_subscribe_messages: bool = ...) -> PubSub: ...
def execute_command(self, *args, **options: _CommandOptions): ...
@@ -338,9 +338,9 @@ class PubSub:
def __init__(
self,
connection_pool,
shard_hint: Incomplete | None = ...,
ignore_subscribe_messages: bool = ...,
encoder: Incomplete | None = ...,
shard_hint: Incomplete | None = None,
ignore_subscribe_messages: bool = False,
encoder: Incomplete | None = None,
) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(
@@ -356,7 +356,7 @@ class PubSub:
def subscribed(self): ...
def execute_command(self, *args): ...
def clean_health_check_responses(self) -> None: ...
def parse_response(self, block: bool = ..., timeout: float = ...): ...
def parse_response(self, block: bool = True, timeout: float = 0): ...
def is_health_check_response(self, response) -> bool: ...
def check_health(self) -> None: ...
def psubscribe(self, *args: _Key, **kwargs: Callable[[Any], None]): ...
@@ -364,17 +364,17 @@ class PubSub:
def subscribe(self, *args: _Key, **kwargs: Callable[[Any], None]) -> None: ...
def unsubscribe(self, *args: _Key) -> None: ...
def listen(self): ...
def get_message(self, ignore_subscribe_messages: bool = ..., timeout: float = ...) -> dict[str, Any] | None: ...
def handle_message(self, response, ignore_subscribe_messages: bool = ...) -> dict[str, Any] | None: ...
def run_in_thread(self, sleep_time: float = ..., daemon: bool = ..., exception_handler: Incomplete | None = ...): ...
def ping(self, message: _Value | None = ...) -> None: ...
def get_message(self, ignore_subscribe_messages: bool = False, timeout: float = 0.0) -> dict[str, Any] | None: ...
def handle_message(self, response, ignore_subscribe_messages: bool = False) -> dict[str, Any] | None: ...
def run_in_thread(self, sleep_time: float = 0, daemon: bool = False, exception_handler: Incomplete | None = None): ...
def ping(self, message: _Value | None = None) -> None: ...
class PubSubWorkerThread(threading.Thread):
daemon: Any
pubsub: Any
sleep_time: Any
exception_handler: Any
def __init__(self, pubsub, sleep_time, daemon: bool = ..., exception_handler: Incomplete | None = ...) -> None: ...
def __init__(self, pubsub, sleep_time, daemon: bool = False, exception_handler: Incomplete | None = None) -> None: ...
def run(self) -> None: ...
def stop(self) -> None: ...
@@ -408,30 +408,30 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
def annotate_exception(self, exception, number, command): ...
def parse_response(self, connection, command_name, **options): ...
def load_scripts(self): ...
def execute(self, raise_on_error: bool = ...) -> list[Any]: ...
def execute(self, raise_on_error: bool = True) -> list[Any]: ...
def watch(self, *names: _Key) -> bool: ...
def unwatch(self) -> bool: ...
# in the Redis implementation, the following methods are inherited from client.
def set_response_callback(self, command, callback): ...
def pipeline(self, transaction: bool = ..., shard_hint: Any = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def acl_cat(self, category: str | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def pipeline(self, transaction: bool = True, shard_hint: Any = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def acl_cat(self, category: str | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def acl_deluser(self, username: str) -> Pipeline[_StrType]: ... # type: ignore[override]
def acl_genpass(self, bits: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def acl_genpass(self, bits: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def acl_getuser(self, username: str) -> Pipeline[_StrType]: ... # type: ignore[override]
def acl_list(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def acl_load(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def acl_setuser( # type: ignore[override]
self,
username: str,
enabled: bool = ...,
nopass: bool = ...,
passwords: Sequence[str] | None = ...,
hashed_passwords: Sequence[str] | None = ...,
categories: Sequence[str] | None = ...,
commands: Sequence[str] | None = ...,
keys: Sequence[str] | None = ...,
channels: Iterable[ChannelT] | None = ...,
selectors: Iterable[tuple[str, KeyT]] | None = ...,
enabled: bool = False,
nopass: bool = False,
passwords: Sequence[str] | None = None,
hashed_passwords: Sequence[str] | None = None,
categories: Sequence[str] | None = None,
commands: Sequence[str] | None = None,
keys: Sequence[str] | None = None,
channels: Iterable[ChannelT] | None = None,
selectors: Iterable[tuple[str, KeyT]] | None = None,
reset: bool = False,
reset_keys: bool = False,
reset_channels: bool = False,
@@ -441,24 +441,24 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
def acl_users(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def acl_whoami(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def bgrewriteaof(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def bgsave(self, schedule: bool = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def bgsave(self, schedule: bool = True) -> Pipeline[_StrType]: ... # type: ignore[override]
def client_id(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def client_kill(self, address: str) -> Pipeline[_StrType]: ... # type: ignore[override]
def client_list(self, _type: str | None = ..., client_id: list[str] = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def client_list(self, _type: str | None = None, client_id: list[str] = []) -> Pipeline[_StrType]: ... # type: ignore[override]
def client_getname(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def client_setname(self, name: str) -> Pipeline[_StrType]: ... # type: ignore[override]
def readwrite(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def readonly(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def config_get(self, pattern: PatternT = ..., *args: PatternT, **kwargs: _CommandOptions) -> Pipeline[_StrType]: ... # type: ignore[override]
def config_get(self, pattern: PatternT = "*", *args: PatternT, **kwargs: _CommandOptions) -> Pipeline[_StrType]: ... # type: ignore[override]
def config_set(self, name: KeyT, value: EncodableT, *args: KeyT | EncodableT, **kwargs: _CommandOptions) -> Pipeline[_StrType]: ... # type: ignore[override]
def config_resetstat(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def config_rewrite(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def dbsize(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def debug_object(self, key) -> Pipeline[_StrType]: ... # type: ignore[override]
def echo(self, value) -> Pipeline[_StrType]: ... # type: ignore[override]
def flushall(self, asynchronous: bool = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def flushdb(self, asynchronous: bool = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def info(self, section: _Key | None = ..., *args: _Key, **kwargs: _CommandOptions) -> Pipeline[_StrType]: ... # type: ignore[override]
def flushall(self, asynchronous: bool = False) -> Pipeline[_StrType]: ... # type: ignore[override]
def flushdb(self, asynchronous: bool = False) -> Pipeline[_StrType]: ... # type: ignore[override]
def info(self, section: _Key | None = None, *args: _Key, **kwargs: _CommandOptions) -> Pipeline[_StrType]: ... # type: ignore[override]
def lastsave(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def object(self, infotype, key) -> Pipeline[_StrType]: ... # type: ignore[override]
def ping(self) -> Pipeline[_StrType]: ... # type: ignore[override]
@@ -471,57 +471,57 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
def sentinel_sentinels(self, service_name) -> Pipeline[_StrType]: ... # type: ignore[override]
def sentinel_set(self, name, option, value) -> Pipeline[_StrType]: ... # type: ignore[override]
def sentinel_slaves(self, service_name) -> Pipeline[_StrType]: ... # type: ignore[override]
def slaveof(self, host=..., port=...) -> Pipeline[_StrType]: ... # type: ignore[override]
def slowlog_get(self, num=...) -> Pipeline[_StrType]: ... # type: ignore[override]
def slaveof(self, host=None, port=None) -> Pipeline[_StrType]: ... # type: ignore[override]
def slowlog_get(self, num=None) -> Pipeline[_StrType]: ... # type: ignore[override]
def slowlog_len(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def slowlog_reset(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def time(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def append(self, key, value) -> Pipeline[_StrType]: ... # type: ignore[override]
def bitcount(self, key: _Key, start: int | None = ..., end: int | None = ..., mode: str | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def bitcount(self, key: _Key, start: int | None = None, end: int | None = None, mode: str | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def bitop(self, operation, dest, *keys) -> Pipeline[_StrType]: ... # type: ignore[override]
def bitpos(self, key, bit, start=..., end=..., mode: str | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def decr(self, name, amount=...) -> Pipeline[_StrType]: ... # type: ignore[override]
def bitpos(self, key, bit, start=None, end=None, mode: str | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def decr(self, name, amount=1) -> Pipeline[_StrType]: ... # type: ignore[override]
def delete(self, *names: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def __delitem__(self, _Key) -> None: ...
def dump(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
def exists(self, *names: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def __contains__(self, *names: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def expire(self, name: _Key, time: int | timedelta, nx: bool = ..., xx: bool = ..., gt: bool = ..., lt: bool = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def expireat(self, name, when, nx: bool = ..., xx: bool = ..., gt: bool = ..., lt: bool = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def expire(self, name: _Key, time: int | timedelta, nx: bool = False, xx: bool = False, gt: bool = False, lt: bool = False) -> Pipeline[_StrType]: ... # type: ignore[override]
def expireat(self, name, when, nx: bool = False, xx: bool = False, gt: bool = False, lt: bool = False) -> Pipeline[_StrType]: ... # type: ignore[override]
def get(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def __getitem__(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
def getbit(self, name: _Key, offset: int) -> Pipeline[_StrType]: ... # type: ignore[override]
def getrange(self, key, start, end) -> Pipeline[_StrType]: ... # type: ignore[override]
def getset(self, name, value) -> Pipeline[_StrType]: ... # type: ignore[override]
def incr(self, name, amount=...) -> Pipeline[_StrType]: ... # type: ignore[override]
def incrby(self, name, amount=...) -> Pipeline[_StrType]: ... # type: ignore[override]
def incrbyfloat(self, name, amount=...) -> Pipeline[_StrType]: ... # type: ignore[override]
def keys(self, pattern: _Key = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def incr(self, name, amount=1) -> Pipeline[_StrType]: ... # type: ignore[override]
def incrby(self, name, amount=1) -> Pipeline[_StrType]: ... # type: ignore[override]
def incrbyfloat(self, name, amount=1.0) -> Pipeline[_StrType]: ... # type: ignore[override]
def keys(self, pattern: _Key = "*") -> Pipeline[_StrType]: ... # type: ignore[override]
def mget(self, keys: _Key | Iterable[_Key], *args: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def mset(self, mapping: Mapping[_Key, _Value]) -> Pipeline[_StrType]: ... # type: ignore[override]
def msetnx(self, mapping: Mapping[_Key, _Value]) -> Pipeline[_StrType]: ... # type: ignore[override]
def move(self, name: _Key, db: int) -> Pipeline[_StrType]: ... # type: ignore[override]
def persist(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def pexpire(self, name: _Key, time: int | timedelta, nx: bool = ..., xx: bool = ..., gt: bool = ..., lt: bool = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def pexpireat(self, name: _Key, when: int | datetime, nx: bool = ..., xx: bool = ..., gt: bool = ..., lt: bool = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def pexpire(self, name: _Key, time: int | timedelta, nx: bool = False, xx: bool = False, gt: bool = False, lt: bool = False) -> Pipeline[_StrType]: ... # type: ignore[override]
def pexpireat(self, name: _Key, when: int | datetime, nx: bool = False, xx: bool = False, gt: bool = False, lt: bool = False) -> Pipeline[_StrType]: ... # type: ignore[override]
def psetex(self, name, time_ms, value) -> Pipeline[_StrType]: ... # type: ignore[override]
def pttl(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
def randomkey(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def rename(self, src, dst) -> Pipeline[_StrType]: ... # type: ignore[override]
def renamenx(self, src, dst) -> Pipeline[_StrType]: ... # type: ignore[override]
def restore(self, name, ttl, value, replace: bool = ..., absttl: bool = ..., idletime: Incomplete | None = ..., frequency: Incomplete | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def restore(self, name, ttl, value, replace: bool = False, absttl: bool = False, idletime: Incomplete | None = None, frequency: Incomplete | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def set( # type: ignore[override]
self,
name: _Key,
value: _Value,
ex: None | int | timedelta = ...,
px: None | int | timedelta = ...,
nx: bool = ...,
xx: bool = ...,
keepttl: bool = ...,
get: bool = ...,
exat: Incomplete | None = ...,
pxat: Incomplete | None = ...,
ex: None | int | timedelta = None,
px: None | int | timedelta = None,
nx: bool = False,
xx: bool = False,
keepttl: bool = False,
get: bool = False,
exat: Incomplete | None = None,
pxat: Incomplete | None = None,
) -> Pipeline[_StrType]: ...
def __setitem__(self, name, value) -> None: ...
def setbit(self, name: _Key, offset: int, value: int) -> Pipeline[_StrType]: ... # type: ignore[override]
@@ -529,7 +529,7 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
def setnx(self, name, value) -> Pipeline[_StrType]: ... # type: ignore[override]
def setrange(self, name, offset, value) -> Pipeline[_StrType]: ... # type: ignore[override]
def strlen(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
def substr(self, name, start, end=...) -> Pipeline[_StrType]: ... # type: ignore[override]
def substr(self, name, start, end=-1) -> Pipeline[_StrType]: ... # type: ignore[override]
def ttl(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def type(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
def unlink(self, *names: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
@@ -538,51 +538,55 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
first_list: _Key,
second_list: _Key,
timeout: float,
src: Literal["LEFT", "RIGHT"] = ...,
dest: Literal["LEFT", "RIGHT"] = ...,
src: Literal["LEFT", "RIGHT"] = "LEFT",
dest: Literal["LEFT", "RIGHT"] = "RIGHT",
) -> Pipeline[_StrType]: ...
def blpop(self, keys: _Value | Iterable[_Value], timeout: float = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def brpop(self, keys: _Value | Iterable[_Value], timeout: float = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def brpoplpush(self, src, dst, timeout=...) -> Pipeline[_StrType]: ... # type: ignore[override]
def blpop(self, keys: _Value | Iterable[_Value], timeout: float = 0) -> Pipeline[_StrType]: ... # type: ignore[override]
def brpop(self, keys: _Value | Iterable[_Value], timeout: float = 0) -> Pipeline[_StrType]: ... # type: ignore[override]
def brpoplpush(self, src, dst, timeout=0) -> Pipeline[_StrType]: ... # type: ignore[override]
def lindex(self, name: _Key, index: int) -> Pipeline[_StrType]: ... # type: ignore[override]
def linsert( # type: ignore[override]
self, name: _Key, where: Literal["BEFORE", "AFTER", "before", "after"], refvalue: _Value, value: _Value
) -> Pipeline[_StrType]: ...
def llen(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def lmove( # type: ignore[override]
self, first_list: _Key, second_list: _Key, src: Literal["LEFT", "RIGHT"] = ..., dest: Literal["LEFT", "RIGHT"] = ...
self,
first_list: _Key,
second_list: _Key,
src: Literal["LEFT", "RIGHT"] = "LEFT",
dest: Literal["LEFT", "RIGHT"] = "RIGHT",
) -> Pipeline[_StrType]: ...
def lpop(self, name, count: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def lpop(self, name, count: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def lpush(self, name: _Value, *values: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def lpushx(self, name, value) -> Pipeline[_StrType]: ... # type: ignore[override]
def lrange(self, name: _Key, start: int, end: int) -> Pipeline[_StrType]: ... # type: ignore[override]
def lrem(self, name: _Key, count: int, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def lset(self, name: _Key, index: int, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def ltrim(self, name: _Key, start: int, end: int) -> Pipeline[_StrType]: ... # type: ignore[override]
def rpop(self, name, count: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def rpop(self, name, count: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def rpoplpush(self, src, dst) -> Pipeline[_StrType]: ... # type: ignore[override]
def rpush(self, name: _Value, *values: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def rpushx(self, name, value) -> Pipeline[_StrType]: ... # type: ignore[override]
def sort( # type: ignore[override]
self,
name: _Key,
start: int | None = ...,
num: int | None = ...,
by: _Key | None = ...,
get: _Key | Sequence[_Key] | None = ...,
desc: bool = ...,
alpha: bool = ...,
store: _Key | None = ...,
groups: bool = ...,
start: int | None = None,
num: int | None = None,
by: _Key | None = None,
get: _Key | Sequence[_Key] | None = None,
desc: bool = False,
alpha: bool = False,
store: _Key | None = None,
groups: bool = False,
) -> Pipeline[_StrType]: ...
def scan(self, cursor: int = ..., match: _Key | None = ..., count: int | None = ..., _type: str | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def scan_iter(self, match: _Key | None = ..., count: int | None = ..., _type: str | None = ...) -> Iterator[Any]: ... # type: ignore[override]
def sscan(self, name: _Key, cursor: int = ..., match: _Key | None = ..., count: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def sscan_iter(self, name: _Key, match: _Key | None = ..., count: int | None = ...) -> Iterator[Any]: ...
def hscan(self, name: _Key, cursor: int = ..., match: _Key | None = ..., count: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def hscan_iter(self, name, match: _Key | None = ..., count: int | None = ...) -> Iterator[Any]: ...
def scan(self, cursor: int = 0, match: _Key | None = None, count: int | None = None, _type: str | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def scan_iter(self, match: _Key | None = None, count: int | None = None, _type: str | None = None) -> Iterator[Any]: ... # type: ignore[override]
def sscan(self, name: _Key, cursor: int = 0, match: _Key | None = None, count: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def sscan_iter(self, name: _Key, match: _Key | None = None, count: int | None = None) -> Iterator[Any]: ...
def hscan(self, name: _Key, cursor: int = 0, match: _Key | None = None, count: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def hscan_iter(self, name, match: _Key | None = None, count: int | None = None) -> Iterator[Any]: ...
def zscan_iter(
self, name: _Key, match: _Key | None = ..., count: int | None = ..., score_cast_func: Callable[[_StrType], Any] = ...
self, name: _Key, match: _Key | None = None, count: int | None = None, score_cast_func: Callable[[_StrType], Any] = ...
) -> Iterator[Any]: ...
def sadd(self, name: _Key, *values: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def scard(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
@@ -593,74 +597,84 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
def sismember(self, name: _Key, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def smembers(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def smove(self, src: _Key, dst: _Key, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def spop(self, name: _Key, count: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def srandmember(self, name: _Key, number: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def spop(self, name: _Key, count: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def srandmember(self, name: _Key, number: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def srem(self, name: _Key, *values: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def sunion(self, keys: _Key | Iterable[_Key], *args: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def sunionstore(self, dest: _Key, keys: _Key | Iterable[_Key], *args: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def xack(self, name, groupname, *ids) -> Pipeline[_StrType]: ... # type: ignore[override]
def xadd(self, name, fields, id=..., maxlen=..., approximate: bool = ..., nomkstream: bool = ..., minid: Incomplete | None = ..., limit: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def xadd(self, name, fields, id="*", maxlen=None, approximate: bool = True, nomkstream: bool = False, minid: Incomplete | None = None, limit: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def xclaim(
self, name, groupname, consumername, min_idle_time, message_ids, idle=..., time=..., retrycount=..., force=..., justid=...
self,
name,
groupname,
consumername,
min_idle_time,
message_ids,
idle=None,
time=None,
retrycount=None,
force=False,
justid=False,
) -> Pipeline[_StrType]: ... # type: ignore[override]
def xdel(self, name, *ids) -> Pipeline[_StrType]: ... # type: ignore[override]
def xgroup_create(self, name, groupname, id=..., mkstream=..., entries_read: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def xgroup_create(self, name, groupname, id="$", mkstream=False, entries_read: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def xgroup_delconsumer(self, name, groupname, consumername) -> Pipeline[_StrType]: ... # type: ignore[override]
def xgroup_destroy(self, name, groupname) -> Pipeline[_StrType]: ... # type: ignore[override]
def xgroup_setid(self, name, groupname, id, entries_read: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def xgroup_setid(self, name, groupname, id, entries_read: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def xinfo_consumers(self, name, groupname) -> Pipeline[_StrType]: ... # type: ignore[override]
def xinfo_groups(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
def xinfo_stream(self, name, full: bool = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def xinfo_stream(self, name, full: bool = False) -> Pipeline[_StrType]: ... # type: ignore[override]
def xlen(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def xpending(self, name, groupname) -> Pipeline[_StrType]: ... # type: ignore[override]
def xpending_range(self, name: _Key, groupname, min, max, count: int, consumername: Incomplete | None = ..., idle: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def xrange(self, name, min=..., max=..., count=...) -> Pipeline[_StrType]: ... # type: ignore[override]
def xread(self, streams, count=..., block=...) -> Pipeline[_StrType]: ... # type: ignore[override]
def xreadgroup(self, groupname, consumername, streams, count=..., block=..., noack=...) -> Pipeline[_StrType]: ... # type: ignore[override]
def xrevrange(self, name, max=..., min=..., count=...) -> Pipeline[_StrType]: ... # type: ignore[override]
def xtrim(self, name, maxlen: int | None = ..., approximate: bool = ..., minid: Incomplete | None = ..., limit: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def xpending_range(self, name: _Key, groupname, min, max, count: int, consumername: Incomplete | None = None, idle: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def xrange(self, name, min="-", max="+", count=None) -> Pipeline[_StrType]: ... # type: ignore[override]
def xread(self, streams, count=None, block=None) -> Pipeline[_StrType]: ... # type: ignore[override]
def xreadgroup(self, groupname, consumername, streams, count=None, block=None, noack=False) -> Pipeline[_StrType]: ... # type: ignore[override]
def xrevrange(self, name, max="+", min="-", count=None) -> Pipeline[_StrType]: ... # type: ignore[override]
def xtrim(self, name, maxlen: int | None = None, approximate: bool = True, minid: Incomplete | None = None, limit: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def zadd( # type: ignore[override]
self,
name: _Key,
mapping: Mapping[_Key, _Value],
nx: bool = ...,
xx: bool = ...,
ch: bool = ...,
incr: bool = ...,
gt: Incomplete | None = ...,
lt: Incomplete | None = ...,
nx: bool = False,
xx: bool = False,
ch: bool = False,
incr: bool = False,
gt: Incomplete | None = False,
lt: Incomplete | None = False,
) -> Pipeline[_StrType]: ...
def zcard(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def zcount(self, name: _Key, min: _Value, max: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def zincrby(self, name: _Key, amount: float, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def zinterstore(self, dest: _Key, keys: Iterable[_Key], aggregate: Literal["SUM", "MIN", "MAX"] | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def zinterstore(self, dest: _Key, keys: Iterable[_Key], aggregate: Literal["SUM", "MIN", "MAX"] | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def zlexcount(self, name: _Key, min: _Value, max: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def zpopmax(self, name: _Key, count: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def zpopmin(self, name: _Key, count: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def bzpopmax(self, keys: _Key | Iterable[_Key], timeout: float = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def bzpopmin(self, keys: _Key | Iterable[_Key], timeout: float = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def zpopmax(self, name: _Key, count: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def zpopmin(self, name: _Key, count: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def bzpopmax(self, keys: _Key | Iterable[_Key], timeout: float = 0) -> Pipeline[_StrType]: ... # type: ignore[override]
def bzpopmin(self, keys: _Key | Iterable[_Key], timeout: float = 0) -> Pipeline[_StrType]: ... # type: ignore[override]
def zrange( # type: ignore[override]
self,
name: _Key,
start: int,
end: int,
desc: bool = ...,
withscores: bool = ...,
desc: bool = False,
withscores: bool = False,
score_cast_func: Callable[[_StrType], Any] = ...,
byscore: bool = ...,
bylex: bool = ...,
offset: int | None = ...,
num: int | None = ...,
byscore: bool = False,
bylex: bool = False,
offset: int | None = None,
num: int | None = None,
) -> Pipeline[_StrType]: ...
def zrangebylex(self, name: _Key, min: _Value, max: _Value, start: int | None = ..., num: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def zrangebylex(self, name: _Key, min: _Value, max: _Value, start: int | None = None, num: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def zrangebyscore( # type: ignore[override]
self,
name: _Key,
min: _Value,
max: _Value,
start: int | None = ...,
num: int | None = ...,
withscores: bool = ...,
start: int | None = None,
num: int | None = None,
withscores: bool = False,
score_cast_func: Callable[[_StrType], Any] = ...,
) -> Pipeline[_StrType]: ...
def zrank(self, name: _Key, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
@@ -669,24 +683,24 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
def zremrangebyrank(self, name: _Key, min: _Value, max: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def zremrangebyscore(self, name: _Key, min: _Value, max: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def zrevrange( # type: ignore[override]
self, name: _Key, start: int, end: int, withscores: bool = ..., score_cast_func: Callable[[_StrType], Any] = ...
self, name: _Key, start: int, end: int, withscores: bool = False, score_cast_func: Callable[[_StrType], Any] = ...
) -> Pipeline[_StrType]: ...
def zrevrangebyscore( # type: ignore[override]
self,
name: _Key,
max: _Value,
min: _Value,
start: int | None = ...,
num: int | None = ...,
withscores: bool = ...,
start: int | None = None,
num: int | None = None,
withscores: bool = False,
score_cast_func: Callable[[_StrType], Any] = ...,
) -> Pipeline[_StrType]: ...
def zrevrangebylex( # type: ignore[override]
self, name: _Key, max: _Value, min: _Value, start: int | None = ..., num: int | None = ...
self, name: _Key, max: _Value, min: _Value, start: int | None = None, num: int | None = None
) -> Pipeline[_StrType]: ...
def zrevrank(self, name: _Key, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def zscore(self, name: _Key, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def zunionstore(self, dest: _Key, keys: Iterable[_Key], aggregate: Literal["SUM", "MIN", "MAX"] | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def zunionstore(self, dest: _Key, keys: Iterable[_Key], aggregate: Literal["SUM", "MIN", "MAX"] | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def pfadd(self, name: _Key, *values: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def pfcount(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def pfmerge(self, dest: _Key, *sources: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
@@ -694,20 +708,20 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
def hexists(self, name: _Key, key: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def hget(self, name: _Key, key: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def hgetall(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def hincrby(self, name: _Key, key: _Key, amount: int = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def hincrbyfloat(self, name: _Key, key: _Key, amount: float = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def hincrby(self, name: _Key, key: _Key, amount: int = 1) -> Pipeline[_StrType]: ... # type: ignore[override]
def hincrbyfloat(self, name: _Key, key: _Key, amount: float = 1.0) -> Pipeline[_StrType]: ... # type: ignore[override]
def hkeys(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def hlen(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
@overload # type: ignore[override]
def hset(
self, name: _Key, key: _Key, value: _Value, mapping: Mapping[_Key, _Value] | None = ..., items: Incomplete | None = ...
self, name: _Key, key: _Key, value: _Value, mapping: Mapping[_Key, _Value] | None = None, items: Incomplete | None = None
) -> Pipeline[_StrType]: ...
@overload # type: ignore[override]
def hset(
self, name: _Key, key: None, value: None, mapping: Mapping[_Key, _Value], items: Incomplete | None = ...
self, name: _Key, key: None, value: None, mapping: Mapping[_Key, _Value], items: Incomplete | None = None
) -> Pipeline[_StrType]: ...
@overload # type: ignore[override]
def hset(self, name: _Key, *, mapping: Mapping[_Key, _Value], items: Incomplete | None = ...) -> Pipeline[_StrType]: ...
def hset(self, name: _Key, *, mapping: Mapping[_Key, _Value], items: Incomplete | None = None) -> Pipeline[_StrType]: ...
def hsetnx(self, name: _Key, key: _Key, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def hmset(self, name: _Key, mapping: Mapping[_Key, _Value]) -> Pipeline[_StrType]: ... # type: ignore[override]
def hmget(self, name: _Key, keys: _Key | Iterable[_Key], *args: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
@@ -716,10 +730,10 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
def eval(self, script, numkeys, *keys_and_args) -> Pipeline[_StrType]: ... # type: ignore[override]
def evalsha(self, sha, numkeys, *keys_and_args) -> Pipeline[_StrType]: ... # type: ignore[override]
def script_exists(self, *args) -> Pipeline[_StrType]: ... # type: ignore[override]
def script_flush(self, sync_type: Incomplete | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def script_flush(self, sync_type: Incomplete | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def script_kill(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def script_load(self, script) -> Pipeline[_StrType]: ... # type: ignore[override]
def pubsub_channels(self, pattern: _Key = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
def pubsub_channels(self, pattern: _Key = "*") -> Pipeline[_StrType]: ... # type: ignore[override]
def pubsub_numsub(self, *args: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def pubsub_numpat(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def monitor(self) -> Monitor: ...

View File

@@ -59,16 +59,16 @@ class RedisCluster(AbstractRedisCluster, RedisClusterCommands[_StrType], Generic
commands_parser: CommandsParser
def __init__( # TODO: make @overloads, either `url` or `host:port` can be passed
self,
host: str | None = ...,
port: int | None = ...,
startup_nodes: list[ClusterNode] | None = ...,
cluster_error_retry_attempts: int = ...,
retry: Retry | None = ...,
require_full_coverage: bool = ...,
reinitialize_steps: int = ...,
read_from_replicas: bool = ...,
dynamic_startup_nodes: bool = ...,
url: str | None = ...,
host: str | None = None,
port: int | None = 6379,
startup_nodes: list[ClusterNode] | None = None,
cluster_error_retry_attempts: int = 3,
retry: Retry | None = None,
require_full_coverage: bool = False,
reinitialize_steps: int = 5,
read_from_replicas: bool = False,
dynamic_startup_nodes: bool = True,
url: str | None = None,
**kwargs,
) -> None: ...
def __enter__(self) -> Self: ...
@@ -82,27 +82,29 @@ class RedisCluster(AbstractRedisCluster, RedisClusterCommands[_StrType], Generic
def on_connect(self, connection: Connection) -> None: ...
def get_redis_connection(self, node: ClusterNode) -> Redis[Any]: ...
def get_node(
self, host: str | None = ..., port: str | int | None = ..., node_name: str | None = ...
self, host: str | None = None, port: str | int | None = None, node_name: str | None = None
) -> ClusterNode | None: ...
def get_primaries(self) -> list[ClusterNode]: ...
def get_replicas(self) -> list[ClusterNode]: ...
def get_random_node(self) -> ClusterNode: ...
def get_nodes(self) -> list[ClusterNode]: ...
def get_node_from_key(self, key: _Encodable, replica: bool = ...) -> ClusterNode | None: ...
def get_node_from_key(self, key: _Encodable, replica: bool = False) -> ClusterNode | None: ...
def get_default_node(self) -> ClusterNode | None: ...
def set_default_node(self, node: ClusterNode | None) -> bool: ...
def monitor(self, target_node: Incomplete | None = ...): ...
def pubsub(self, node: Incomplete | None = ..., host: Incomplete | None = ..., port: Incomplete | None = ..., **kwargs): ...
def pipeline(self, transaction: Incomplete | None = ..., shard_hint: Incomplete | None = ...): ...
def monitor(self, target_node: Incomplete | None = None): ...
def pubsub(
self, node: Incomplete | None = None, host: Incomplete | None = None, port: Incomplete | None = None, **kwargs
): ...
def pipeline(self, transaction: Incomplete | None = None, shard_hint: Incomplete | None = None): ...
def lock(
self,
name: str,
timeout: float | None = ...,
sleep: float = ...,
blocking: bool = ...,
blocking_timeout: float | None = ...,
lock_class: type[Incomplete] | None = ...,
thread_local: bool = ...,
timeout: float | None = None,
sleep: float = 0.1,
blocking: bool = True,
blocking_timeout: float | None = None,
lock_class: type[Incomplete] | None = None,
thread_local: bool = True,
): ...
def keyslot(self, key: _Encodable) -> int: ...
def determine_slot(self, *args): ...
@@ -118,7 +120,7 @@ class ClusterNode:
server_type: str | None
redis_connection: Redis[Incomplete] | None
def __init__(
self, host: str, port: int, server_type: str | None = ..., redis_connection: Redis[Incomplete] | None = ...
self, host: str, port: int, server_type: str | None = None, redis_connection: Redis[Incomplete] | None = None
) -> None: ...
def __eq__(self, obj: object) -> bool: ...
def __del__(self) -> None: ...
@@ -126,7 +128,7 @@ class ClusterNode:
class LoadBalancer:
primary_to_idx: dict[str, int]
start_index: int
def __init__(self, start_index: int = ...) -> None: ...
def __init__(self, start_index: int = 0) -> None: ...
def get_server_index(self, primary: str, list_size: int) -> int: ...
def reset(self) -> None: ...
@@ -150,10 +152,10 @@ class NodesManager:
**kwargs, # TODO: same type as connection_kwargs
) -> None: ...
def get_node(
self, host: str | None = ..., port: int | str | None = ..., node_name: str | None = ...
self, host: str | None = None, port: int | str | None = None, node_name: str | None = None
) -> ClusterNode | None: ...
def update_moved_exception(self, exception: MovedError) -> None: ...
def get_node_from_slot(self, slot: str, read_from_replicas: bool = ..., server_type: str | None = ...) -> ClusterNode: ...
def get_node_from_slot(self, slot: str, read_from_replicas: bool = False, server_type: str | None = None) -> ClusterNode: ...
def get_nodes_by_server_type(self, server_type: str) -> list[ClusterNode]: ...
def populate_startup_nodes(self, nodes: Iterable[ClusterNode]) -> None: ...
def check_slots_coverage(self, slots_cache: dict[str, list[ClusterNode]]) -> bool: ...
@@ -169,13 +171,13 @@ class ClusterPubSub(PubSub):
def __init__(
self,
redis_cluster: RedisCluster[Any],
node: ClusterNode | None = ...,
host: str | None = ...,
port: int | None = ...,
node: ClusterNode | None = None,
host: str | None = None,
port: int | None = None,
**kwargs,
) -> None: ...
def set_pubsub_node(
self, cluster: RedisCluster[Any], node: ClusterNode | None = ..., host: str | None = ..., port: int | None = ...
self, cluster: RedisCluster[Any], node: ClusterNode | None = None, host: str | None = None, port: int | None = None
) -> None: ...
def get_pubsub_node(self) -> ClusterNode | None: ...
def execute_command(self, *args, **kwargs) -> None: ...
@@ -199,13 +201,13 @@ class ClusterPipeline(RedisCluster[_StrType], Generic[_StrType]):
self,
nodes_manager,
commands_parser,
result_callbacks: Incomplete | None = ...,
cluster_response_callbacks: Incomplete | None = ...,
startup_nodes: Incomplete | None = ...,
read_from_replicas: bool = ...,
cluster_error_retry_attempts: int = ...,
reinitialize_steps: int = ...,
lock: Lock | None = ...,
result_callbacks: Incomplete | None = None,
cluster_response_callbacks: Incomplete | None = None,
startup_nodes: Incomplete | None = None,
read_from_replicas: bool = False,
cluster_error_retry_attempts: int = 3,
reinitialize_steps: int = 5,
lock: Lock | None = None,
**kwargs,
) -> None: ...
def __len__(self) -> int: ...
@@ -214,12 +216,12 @@ class ClusterPipeline(RedisCluster[_StrType], Generic[_StrType]):
def pipeline_execute_command(self, *args, **options): ...
def raise_first_error(self, stack) -> None: ...
def annotate_exception(self, exception, number, command) -> None: ...
def execute(self, raise_on_error: bool = ...): ...
def execute(self, raise_on_error: bool = True): ...
scripts: set[Any] # is only set in `reset()`
watching: bool # is only set in `reset()`
explicit_transaction: bool # is only set in `reset()`
def reset(self) -> None: ...
def send_cluster_commands(self, stack, raise_on_error: bool = ..., allow_redirections: bool = ...): ...
def send_cluster_commands(self, stack, raise_on_error: bool = True, allow_redirections: bool = True): ...
def eval(self) -> None: ...
def multi(self) -> None: ...
def immediate_execute_command(self, *args, **options) -> None: ...
@@ -239,7 +241,7 @@ class PipelineCommand:
node: Incomplete | None
asking: bool
def __init__(
self, args: Sequence[EncodableT], options: _ParseResponseOptions | None = ..., position: int | None = ...
self, args: Sequence[EncodableT], options: _ParseResponseOptions | None = None, position: int | None = None
) -> None: ...
class _ParseResponseCallback(Protocol):

View File

@@ -44,18 +44,18 @@ TDIGEST_MAX: str
TDIGEST_INFO: str
class BFCommands:
def create(self, key, errorRate, capacity, expansion: Incomplete | None = ..., noScale: Incomplete | None = ...): ...
def create(self, key, errorRate, capacity, expansion: Incomplete | None = None, noScale: Incomplete | None = None): ...
def add(self, key, item): ...
def madd(self, key, *items): ...
def insert(
self,
key,
items,
capacity: Incomplete | None = ...,
error: Incomplete | None = ...,
noCreate: Incomplete | None = ...,
expansion: Incomplete | None = ...,
noScale: Incomplete | None = ...,
capacity: Incomplete | None = None,
error: Incomplete | None = None,
noCreate: Incomplete | None = None,
expansion: Incomplete | None = None,
noScale: Incomplete | None = None,
): ...
def exists(self, key, item): ...
def mexists(self, key, *items): ...
@@ -68,14 +68,14 @@ class CFCommands:
self,
key,
capacity,
expansion: Incomplete | None = ...,
bucket_size: Incomplete | None = ...,
max_iterations: Incomplete | None = ...,
expansion: Incomplete | None = None,
bucket_size: Incomplete | None = None,
max_iterations: Incomplete | None = None,
): ...
def add(self, key, item): ...
def addnx(self, key, item): ...
def insert(self, key, items, capacity: Incomplete | None = ..., nocreate: Incomplete | None = ...): ...
def insertnx(self, key, items, capacity: Incomplete | None = ..., nocreate: Incomplete | None = ...): ...
def insert(self, key, items, capacity: Incomplete | None = None, nocreate: Incomplete | None = None): ...
def insertnx(self, key, items, capacity: Incomplete | None = None, nocreate: Incomplete | None = None): ...
def exists(self, key, item): ...
def delete(self, key, item): ...
def count(self, key, item): ...
@@ -89,14 +89,14 @@ class TOPKCommands:
def incrby(self, key, items, increments): ...
def query(self, key, *items): ...
def count(self, key, *items): ...
def list(self, key, withcount: bool = ...): ...
def list(self, key, withcount: bool = False): ...
def info(self, key): ...
class TDigestCommands:
def create(self, key, compression: int = ...): ...
def create(self, key, compression: int = 100): ...
def reset(self, key): ...
def add(self, key, values): ...
def merge(self, destination_key, num_keys, *keys, compression: int | None = ..., override: bool = ...): ...
def merge(self, destination_key, num_keys, *keys, compression: int | None = None, override: bool = False): ...
def min(self, key): ...
def max(self, key): ...
def quantile(self, key, quantile, *quantiles): ...
@@ -108,5 +108,5 @@ class CMSCommands:
def initbyprob(self, key, error, probability): ...
def incrby(self, key, items, increments): ...
def query(self, key, *items): ...
def merge(self, destKey, numKeys, srcKeys, weights=...): ...
def merge(self, destKey, numKeys, srcKeys, weights=[]): ...
def info(self, key): ...

View File

@@ -22,11 +22,11 @@ class ClusterDataAccessCommands(DataAccessCommands[_StrType], Generic[_StrType])
algo,
value1,
value2,
specific_argument: str = ...,
len: bool = ...,
idx: bool = ...,
minmatchlen: Incomplete | None = ...,
withmatchlen: bool = ...,
specific_argument: str = "strings",
len: bool = False,
idx: bool = False,
minmatchlen: Incomplete | None = None,
withmatchlen: bool = False,
**kwargs,
): ...
@@ -42,20 +42,20 @@ class RedisClusterCommands(
def cluster_countkeysinslot(self, slot_id): ...
def cluster_count_failure_report(self, node_id): ...
def cluster_delslots(self, *slots): ...
def cluster_failover(self, target_node, option: Incomplete | None = ...): ...
def cluster_info(self, target_nodes: Incomplete | None = ...): ...
def cluster_failover(self, target_node, option: Incomplete | None = None): ...
def cluster_info(self, target_nodes: Incomplete | None = None): ...
def cluster_keyslot(self, key): ...
def cluster_meet(self, host, port, target_nodes: Incomplete | None = ...): ...
def cluster_meet(self, host, port, target_nodes: Incomplete | None = None): ...
def cluster_nodes(self): ...
def cluster_replicate(self, target_nodes, node_id): ...
def cluster_reset(self, soft: bool = ..., target_nodes: Incomplete | None = ...): ...
def cluster_save_config(self, target_nodes: Incomplete | None = ...): ...
def cluster_reset(self, soft: bool = True, target_nodes: Incomplete | None = None): ...
def cluster_save_config(self, target_nodes: Incomplete | None = None): ...
def cluster_get_keys_in_slot(self, slot, num_keys): ...
def cluster_set_config_epoch(self, epoch, target_nodes: Incomplete | None = ...): ...
def cluster_set_config_epoch(self, epoch, target_nodes: Incomplete | None = None): ...
def cluster_setslot(self, target_node, node_id, slot_id, state): ...
def cluster_setslot_stable(self, slot_id): ...
def cluster_replicas(self, node_id, target_nodes: Incomplete | None = ...): ...
def cluster_slots(self, target_nodes: Incomplete | None = ...): ...
def cluster_replicas(self, node_id, target_nodes: Incomplete | None = None): ...
def cluster_slots(self, target_nodes: Incomplete | None = None): ...
read_from_replicas: bool
def readonly(self, target_nodes: Incomplete | None = ...): ...
def readwrite(self, target_nodes: Incomplete | None = ...): ...
def readonly(self, target_nodes: Incomplete | None = None): ...
def readwrite(self, target_nodes: Incomplete | None = None): ...

File diff suppressed because it is too large Load Diff

View File

@@ -20,7 +20,7 @@ class Graph(GraphCommands):
def get_property(self, idx): ...
def add_node(self, node) -> None: ...
def add_edge(self, edge) -> None: ...
def call_procedure(self, procedure, *args, read_only: bool = ..., **kwagrs): ...
def call_procedure(self, procedure, *args, read_only: bool = False, **kwagrs): ...
def labels(self): ...
def relationship_types(self): ...
def property_keys(self): ...

View File

@@ -5,16 +5,21 @@ class GraphCommands:
def commit(self): ...
version: Any
def query(
self, q, params: Incomplete | None = ..., timeout: Incomplete | None = ..., read_only: bool = ..., profile: bool = ...
self,
q,
params: Incomplete | None = None,
timeout: Incomplete | None = None,
read_only: bool = False,
profile: bool = False,
): ...
def merge(self, pattern): ...
def delete(self): ...
nodes: Any
edges: Any
def flush(self) -> None: ...
def explain(self, query, params: Incomplete | None = ...): ...
def explain(self, query, params: Incomplete | None = None): ...
def bulk(self, **kwargs) -> None: ...
def profile(self, query): ...
def slowlog(self): ...
def config(self, name, value: Incomplete | None = ..., set: bool = ...): ...
def config(self, name, value: Incomplete | None = None, set: bool = False): ...
def list_keys(self): ...

View File

@@ -8,7 +8,7 @@ class Edge:
src_node: Any
dest_node: Any
def __init__(
self, src_node, relation, dest_node, edge_id: Incomplete | None = ..., properties: Incomplete | None = ...
self, src_node, relation, dest_node, edge_id: Incomplete | None = None, properties: Incomplete | None = None
) -> None: ...
def to_string(self): ...
def __eq__(self, rhs): ...

View File

@@ -9,10 +9,10 @@ class Node:
properties: Any
def __init__(
self,
node_id: Incomplete | None = ...,
alias: Incomplete | None = ...,
label: str | list[str] | None = ...,
properties: Incomplete | None = ...,
node_id: Incomplete | None = None,
alias: Incomplete | None = None,
label: str | list[str] | None = None,
properties: Incomplete | None = None,
) -> None: ...
def to_string(self): ...
def __eq__(self, rhs): ...

View File

@@ -37,7 +37,7 @@ class QueryResult:
graph: Any
header: Any
result_set: Any
def __init__(self, graph, response, profile: bool = ...) -> None: ...
def __init__(self, graph, response, profile: bool = False) -> None: ...
def parse_results(self, raw_result_set) -> None: ...
statistics: Any
def parse_statistics(self, raw_statistics) -> None: ...

View File

@@ -4,7 +4,7 @@ def delist(x): ...
def parse_to_list(response): ...
def parse_list_to_dict(response): ...
def parse_to_dict(response): ...
def random_string(length: int = ...) -> str: ...
def random_string(length: int = 10) -> str: ...
def quote_string(v): ...
def decode_dict_keys(obj): ...
def stringify_param_value(value): ...

View File

@@ -9,7 +9,7 @@ class JSON(JSONCommands):
client: Any
execute_command: Any
MODULE_VERSION: Incomplete | None
def __init__(self, client, version: Incomplete | None = ..., decoder=..., encoder=...) -> None: ...
def pipeline(self, transaction: bool = ..., shard_hint: Incomplete | None = ...) -> Pipeline: ...
def __init__(self, client, version: Incomplete | None = None, decoder=..., encoder=...) -> None: ...
def pipeline(self, transaction: bool = True, shard_hint: Incomplete | None = None) -> Pipeline: ...
class Pipeline(JSONCommands, ClientPipeline[Incomplete]): ... # type: ignore[misc]

View File

@@ -1,32 +1,32 @@
from _typeshed import Incomplete
class JSONCommands:
def arrappend(self, name: str, path: str | None = ..., *args) -> list[int | None]: ...
def arrappend(self, name: str, path: str | None = ".", *args) -> list[int | None]: ...
def arrindex(
self, name: str, path: str, scalar: int, start: int | None = None, stop: int | None = None
) -> list[int | None]: ...
def arrinsert(self, name: str, path: str, index: int, *args) -> list[int | None]: ...
def arrlen(self, name: str, path: str | None = ...) -> list[int | None]: ...
def arrpop(self, name: str, path: str | None = ..., index: int | None = -1) -> list[str | None]: ...
def arrlen(self, name: str, path: str | None = ".") -> list[int | None]: ...
def arrpop(self, name: str, path: str | None = ".", index: int | None = -1) -> list[str | None]: ...
def arrtrim(self, name: str, path: str, start: int, stop: int) -> list[int | None]: ...
def type(self, name: str, path: str | None = ...) -> list[str]: ...
def resp(self, name: str, path: str | None = ...) -> list[Incomplete]: ...
def objkeys(self, name, path=...): ...
def objlen(self, name, path=...): ...
def type(self, name: str, path: str | None = ".") -> list[str]: ...
def resp(self, name: str, path: str | None = ".") -> list[Incomplete]: ...
def objkeys(self, name, path="."): ...
def objlen(self, name, path="."): ...
def numincrby(self, name, path, number): ...
def nummultby(self, name, path, number): ...
def clear(self, name, path=...): ...
def delete(self, key, path=...): ...
def clear(self, name, path="."): ...
def delete(self, key, path="."): ...
forget = delete
def get(self, name, *args, no_escape: bool = ...): ...
def get(self, name, *args, no_escape: bool = False): ...
def mget(self, keys, path): ...
def set(self, name, path, obj, nx: bool = ..., xx: bool = ..., decode_keys: bool = ...): ...
def set_file(self, name, path, file_name, nx: bool = ..., xx: bool = ..., decode_keys: bool = ...): ...
def set_path(self, json_path, root_folder, nx: bool = ..., xx: bool = ..., decode_keys: bool = ...): ...
def strlen(self, name, path: Incomplete | None = ...): ...
def toggle(self, name, path=...): ...
def strappend(self, name, value, path=...): ...
def debug(self, subcommand, key: Incomplete | None = ..., path=...): ...
def set(self, name, path, obj, nx: bool = False, xx: bool = False, decode_keys: bool = False): ...
def set_file(self, name, path, file_name, nx: bool = False, xx: bool = False, decode_keys: bool = False): ...
def set_path(self, json_path, root_folder, nx: bool = False, xx: bool = False, decode_keys: bool = False): ...
def strlen(self, name, path: Incomplete | None = None): ...
def toggle(self, name, path="."): ...
def strappend(self, name, value, path="."): ...
def debug(self, subcommand, key: Incomplete | None = None, path="."): ...
def jsonget(self, *args, **kwargs): ...
def jsonmget(self, *args, **kwargs): ...
def jsonset(self, *args, **kwargs): ...

View File

@@ -4,11 +4,11 @@ from .timeseries import TimeSeries
class RedisModuleCommands:
def json(self, encoder=..., decoder=...) -> JSON: ...
def ft(self, index_name: str = ...) -> Search: ...
def ft(self, index_name: str = "idx") -> Search: ...
def ts(self) -> TimeSeries: ...
def bf(self): ...
def cf(self): ...
def cms(self): ...
def topk(self): ...
def tdigest(self): ...
def graph(self, index_name: str = ...): ...
def graph(self, index_name: str = "idx"): ...

View File

@@ -4,19 +4,19 @@ from .commands import SearchCommands
class Search(SearchCommands):
class BatchIndexer:
def __init__(self, client, chunk_size: int = ...) -> None: ...
def __init__(self, client, chunk_size: int = 1000) -> None: ...
def add_document(
self,
doc_id,
nosave: bool = ...,
score: float = ...,
payload: Incomplete | None = ...,
replace: bool = ...,
partial: bool = ...,
no_create: bool = ...,
nosave: bool = False,
score: float = 1.0,
payload: Incomplete | None = None,
replace: bool = False,
partial: bool = False,
no_create: bool = False,
**fields,
): ...
def add_document_hash(self, doc_id, score: float = ..., replace: bool = ...): ...
def add_document_hash(self, doc_id, score: float = 1.0, replace: bool = False): ...
def commit(self): ...
def __init__(self, client, index_name: str = ...) -> None: ...
def __init__(self, client, index_name: str = "idx") -> None: ...

View File

@@ -6,7 +6,7 @@ FIELDNAME: Any
class Limit:
offset: Any
count: Any
def __init__(self, offset: int = ..., count: int = ...) -> None: ...
def __init__(self, offset: int = 0, count: int = 0) -> None: ...
def build_args(self): ...
class Reducer:
@@ -28,7 +28,7 @@ class Desc(SortDirection):
DIRSTRING: ClassVar[Literal["DESC"]]
class AggregateRequest:
def __init__(self, query: str = ...) -> None: ...
def __init__(self, query: str = "*") -> None: ...
def load(self, *fields): ...
def group_by(self, fields, *reducers): ...
def apply(self, **kwexpr): ...
@@ -37,7 +37,7 @@ class AggregateRequest:
def filter(self, expressions): ...
def with_schema(self): ...
def verbatim(self): ...
def cursor(self, count: int = ..., max_idle: float = ...): ...
def cursor(self, count: int = 0, max_idle: float = 0.0): ...
def build_args(self): ...
class Cursor:

View File

@@ -50,49 +50,49 @@ FUZZY: Literal["FUZZY"]
WITHPAYLOADS: Literal["WITHPAYLOADS"]
class SearchCommands:
def batch_indexer(self, chunk_size: int = ...): ...
def batch_indexer(self, chunk_size: int = 100): ...
def create_index(
self,
fields,
no_term_offsets: bool = ...,
no_field_flags: bool = ...,
stopwords: Incomplete | None = ...,
definition: Incomplete | None = ...,
max_text_fields: bool = ..., # added in 4.1.1
temporary: Incomplete | None = ..., # added in 4.1.1
no_highlight: bool = ..., # added in 4.1.1
no_term_frequencies: bool = ..., # added in 4.1.1
skip_initial_scan: bool = ..., # added in 4.1.1
no_term_offsets: bool = False,
no_field_flags: bool = False,
stopwords: Incomplete | None = None,
definition: Incomplete | None = None,
max_text_fields: bool = False, # added in 4.1.1
temporary: Incomplete | None = None, # added in 4.1.1
no_highlight: bool = False, # added in 4.1.1
no_term_frequencies: bool = False, # added in 4.1.1
skip_initial_scan: bool = False, # added in 4.1.1
): ...
def alter_schema_add(self, fields): ...
def dropindex(self, delete_documents: bool = ...): ...
def dropindex(self, delete_documents: bool = False): ...
def add_document(
self,
doc_id,
nosave: bool = ...,
score: float = ...,
payload: Incomplete | None = ...,
replace: bool = ...,
partial: bool = ...,
language: Incomplete | None = ...,
no_create: bool = ...,
nosave: bool = False,
score: float = 1.0,
payload: Incomplete | None = None,
replace: bool = False,
partial: bool = False,
language: Incomplete | None = None,
no_create: bool = False,
**fields,
): ...
def add_document_hash(self, doc_id, score: float = ..., language: Incomplete | None = ..., replace: bool = ...): ...
def delete_document(self, doc_id, conn: Incomplete | None = ..., delete_actual_document: bool = ...): ...
def add_document_hash(self, doc_id, score: float = 1.0, language: Incomplete | None = None, replace: bool = False): ...
def delete_document(self, doc_id, conn: Incomplete | None = None, delete_actual_document: bool = False): ...
def load_document(self, id): ...
def get(self, *ids): ...
def info(self): ...
def get_params_args(self, query_params: _QueryParams) -> list[Any]: ...
def search(self, query: str | Query, query_params: _QueryParams | None = ...) -> Result: ...
def explain(self, query: str | Query, query_params: _QueryParams | None = ...): ...
def search(self, query: str | Query, query_params: _QueryParams | None = None) -> Result: ...
def explain(self, query: str | Query, query_params: _QueryParams | None = None): ...
def explain_cli(self, query): ...
def aggregate(self, query: AggregateRequest | Cursor, query_params: _QueryParams | None = ...) -> AggregateResult: ...
def aggregate(self, query: AggregateRequest | Cursor, query_params: _QueryParams | None = None) -> AggregateResult: ...
def profile(
self, query: str | Query | AggregateRequest, limited: bool = ..., query_params: Mapping[str, str | float] | None = ...
self, query: str | Query | AggregateRequest, limited: bool = False, query_params: Mapping[str, str | float] | None = None
) -> tuple[Incomplete, Incomplete]: ...
def spellcheck(
self, query, distance: Incomplete | None = ..., include: Incomplete | None = ..., exclude: Incomplete | None = ...
self, query, distance: Incomplete | None = None, include: Incomplete | None = None, exclude: Incomplete | None = None
): ...
def dict_add(self, name, *terms): ...
def dict_del(self, name, *terms): ...
@@ -106,6 +106,6 @@ class SearchCommands:
def sugadd(self, key, *suggestions, **kwargs): ...
def suglen(self, key): ...
def sugdel(self, key, string): ...
def sugget(self, key, prefix, fuzzy: bool = ..., num: int = ..., with_scores: bool = ..., with_payloads: bool = ...): ...
def synupdate(self, groupid, skipinitial: bool = ..., *terms): ...
def sugget(self, key, prefix, fuzzy: bool = False, num: int = 10, with_scores: bool = False, with_payloads: bool = False): ...
def synupdate(self, groupid, skipinitial: bool = False, *terms): ...
def syndump(self): ...

View File

@@ -6,15 +6,15 @@ class Query:
def query_string(self): ...
def limit_ids(self, *ids): ...
def return_fields(self, *fields): ...
def return_field(self, field, as_field: Incomplete | None = ...): ...
def return_field(self, field, as_field: Incomplete | None = None): ...
def summarize(
self,
fields: Incomplete | None = ...,
context_len: Incomplete | None = ...,
num_frags: Incomplete | None = ...,
sep: Incomplete | None = ...,
fields: Incomplete | None = None,
context_len: Incomplete | None = None,
num_frags: Incomplete | None = None,
sep: Incomplete | None = None,
): ...
def highlight(self, fields: Incomplete | None = ..., tags: Incomplete | None = ...): ...
def highlight(self, fields: Incomplete | None = None, tags: Incomplete | None = None): ...
def language(self, language): ...
def slop(self, slop): ...
def in_order(self): ...
@@ -28,7 +28,7 @@ class Query:
def with_scores(self): ...
def limit_fields(self, *fields): ...
def add_filter(self, flt): ...
def sort_by(self, field, asc: bool = ...): ...
def sort_by(self, field, asc: bool = True): ...
def expander(self, expander): ...
class Filter:
@@ -38,15 +38,15 @@ class Filter:
class NumericFilter(Filter):
INF: str
NEG_INF: str
def __init__(self, field, minval, maxval, minExclusive: bool = ..., maxExclusive: bool = ...) -> None: ...
def __init__(self, field, minval, maxval, minExclusive: bool = False, maxExclusive: bool = False) -> None: ...
class GeoFilter(Filter):
METERS: str
KILOMETERS: str
FEET: str
MILES: str
def __init__(self, field, lon, lat, radius, unit=...) -> None: ...
def __init__(self, field, lon, lat, radius, unit="km") -> None: ...
class SortbyField:
args: Any
def __init__(self, field, asc: bool = ...) -> None: ...
def __init__(self, field, asc: bool = True) -> None: ...

View File

@@ -4,4 +4,4 @@ class Result:
total: Any
duration: Any
docs: Any
def __init__(self, res, hascontent, duration: int = ..., has_payload: bool = ..., with_scores: bool = ...) -> None: ...
def __init__(self, res, hascontent, duration: int = 0, has_payload: bool = False, with_scores: bool = False) -> None: ...

View File

@@ -8,7 +8,7 @@ class TimeSeries(TimeSeriesCommands):
MODULE_CALLBACKS: dict[str, Any]
client: Any
execute_command: Any
def __init__(self, client: Incomplete | None = ..., **kwargs) -> None: ...
def pipeline(self, transaction: bool = ..., shard_hint: Incomplete | None = ...) -> Pipeline: ...
def __init__(self, client: Incomplete | None = None, **kwargs) -> None: ...
def pipeline(self, transaction: bool = True, shard_hint: Incomplete | None = None) -> Pipeline: ...
class Pipeline(TimeSeriesCommands, ClientPipeline[Incomplete]): ... # type: ignore[misc]

View File

@@ -24,55 +24,55 @@ class TimeSeriesCommands:
def create(
self,
key: _Key,
retention_msecs: int | None = ...,
uncompressed: bool | None = ...,
labels: dict[str, str] | None = ...,
chunk_size: int | None = ...,
duplicate_policy: str | None = ...,
retention_msecs: int | None = None,
uncompressed: bool | None = False,
labels: dict[str, str] | None = None,
chunk_size: int | None = None,
duplicate_policy: str | None = None,
): ...
def alter(
self,
key: _Key,
retention_msecs: int | None = ...,
labels: dict[str, str] | None = ...,
chunk_size: int | None = ...,
duplicate_policy: str | None = ...,
retention_msecs: int | None = None,
labels: dict[str, str] | None = None,
chunk_size: int | None = None,
duplicate_policy: str | None = None,
): ...
def add(
self,
key: _Key,
timestamp: int | str,
value: float,
retention_msecs: int | None = ...,
uncompressed: bool | None = ...,
labels: dict[str, str] | None = ...,
chunk_size: int | None = ...,
duplicate_policy: str | None = ...,
retention_msecs: int | None = None,
uncompressed: bool | None = False,
labels: dict[str, str] | None = None,
chunk_size: int | None = None,
duplicate_policy: str | None = None,
): ...
def madd(self, ktv_tuples): ...
def incrby(
self,
key: _Key,
value: float,
timestamp: int | str | None = ...,
retention_msecs: int | None = ...,
uncompressed: bool | None = ...,
labels: dict[str, str] | None = ...,
chunk_size: int | None = ...,
timestamp: int | str | None = None,
retention_msecs: int | None = None,
uncompressed: bool | None = False,
labels: dict[str, str] | None = None,
chunk_size: int | None = None,
): ...
def decrby(
self,
key: _Key,
value: float,
timestamp: int | str | None = ...,
retention_msecs: int | None = ...,
uncompressed: bool | None = ...,
labels: dict[str, str] | None = ...,
chunk_size: int | None = ...,
timestamp: int | str | None = None,
retention_msecs: int | None = None,
uncompressed: bool | None = False,
labels: dict[str, str] | None = None,
chunk_size: int | None = None,
): ...
def delete(self, key, from_time, to_time): ...
def createrule(
self, source_key: _Key, dest_key: _Key, aggregation_type: str, bucket_size_msec: int, align_timestamp: int | None = ...
self, source_key: _Key, dest_key: _Key, aggregation_type: str, bucket_size_msec: int, align_timestamp: int | None = None
): ...
def deleterule(self, source_key, dest_key): ...
def range(
@@ -80,76 +80,80 @@ class TimeSeriesCommands:
key: _Key,
from_time: int | str,
to_time: int | str,
count: int | None = ...,
aggregation_type: str | None = ...,
bucket_size_msec: int | None = ...,
filter_by_ts: list[int] | None = ...,
filter_by_min_value: int | None = ...,
filter_by_max_value: int | None = ...,
align: int | str | None = ...,
latest: bool | None = ...,
bucket_timestamp: str | None = ...,
empty: bool | None = ...,
count: int | None = None,
aggregation_type: str | None = None,
bucket_size_msec: int | None = 0,
filter_by_ts: list[int] | None = None,
filter_by_min_value: int | None = None,
filter_by_max_value: int | None = None,
align: int | str | None = None,
latest: bool | None = False,
bucket_timestamp: str | None = None,
empty: bool | None = False,
): ...
def revrange(
self,
key: _Key,
from_time: int | str,
to_time: int | str,
count: int | None = ...,
aggregation_type: str | None = ...,
bucket_size_msec: int | None = ...,
filter_by_ts: list[int] | None = ...,
filter_by_min_value: int | None = ...,
filter_by_max_value: int | None = ...,
align: int | str | None = ...,
latest: bool | None = ...,
bucket_timestamp: str | None = ...,
empty: bool | None = ...,
count: int | None = None,
aggregation_type: str | None = None,
bucket_size_msec: int | None = 0,
filter_by_ts: list[int] | None = None,
filter_by_min_value: int | None = None,
filter_by_max_value: int | None = None,
align: int | str | None = None,
latest: bool | None = False,
bucket_timestamp: str | None = None,
empty: bool | None = False,
): ...
def mrange(
self,
from_time: int | str,
to_time: int | str,
filters: list[str],
count: int | None = ...,
aggregation_type: str | None = ...,
bucket_size_msec: int | None = ...,
with_labels: bool | None = ...,
filter_by_ts: list[int] | None = ...,
filter_by_min_value: int | None = ...,
filter_by_max_value: int | None = ...,
groupby: str | None = ...,
reduce: str | None = ...,
select_labels: list[str] | None = ...,
align: int | str | None = ...,
latest: bool | None = ...,
bucket_timestamp: str | None = ...,
empty: bool | None = ...,
count: int | None = None,
aggregation_type: str | None = None,
bucket_size_msec: int | None = 0,
with_labels: bool | None = False,
filter_by_ts: list[int] | None = None,
filter_by_min_value: int | None = None,
filter_by_max_value: int | None = None,
groupby: str | None = None,
reduce: str | None = None,
select_labels: list[str] | None = None,
align: int | str | None = None,
latest: bool | None = False,
bucket_timestamp: str | None = None,
empty: bool | None = False,
): ...
def mrevrange(
self,
from_time: int | str,
to_time: int | str,
filters: list[str],
count: int | None = ...,
aggregation_type: str | None = ...,
bucket_size_msec: int | None = ...,
with_labels: bool | None = ...,
filter_by_ts: list[int] | None = ...,
filter_by_min_value: int | None = ...,
filter_by_max_value: int | None = ...,
groupby: str | None = ...,
reduce: str | None = ...,
select_labels: list[str] | None = ...,
align: int | str | None = ...,
latest: bool | None = ...,
bucket_timestamp: str | None = ...,
empty: bool | None = ...,
count: int | None = None,
aggregation_type: str | None = None,
bucket_size_msec: int | None = 0,
with_labels: bool | None = False,
filter_by_ts: list[int] | None = None,
filter_by_min_value: int | None = None,
filter_by_max_value: int | None = None,
groupby: str | None = None,
reduce: str | None = None,
select_labels: list[str] | None = None,
align: int | str | None = None,
latest: bool | None = False,
bucket_timestamp: str | None = None,
empty: bool | None = False,
): ...
def get(self, key: _Key, latest: bool | None = ...): ...
def get(self, key: _Key, latest: bool | None = False): ...
def mget(
self, filters: list[str], with_labels: bool | None = ..., select_labels: list[str] | None = ..., latest: bool | None = ...
self,
filters: list[str],
with_labels: bool | None = False,
select_labels: list[str] | None = None,
latest: bool | None = False,
): ...
def info(self, key): ...
def queryindex(self, filters): ...

View File

@@ -57,7 +57,7 @@ class PythonParser(BaseParser):
def on_connect(self, connection: Connection) -> None: ...
def on_disconnect(self) -> None: ...
def can_read(self, timeout: float | None) -> bool: ...
def read_response(self, disable_decoding: bool = ...) -> Any: ... # `str | bytes` or `list[str | bytes]`
def read_response(self, disable_decoding: bool = False) -> Any: ... # `str | bytes` or `list[str | bytes]`
class HiredisParser(BaseParser):
socket_read_size: int
@@ -66,8 +66,8 @@ class HiredisParser(BaseParser):
def on_connect(self, connection: Connection, **kwargs) -> None: ...
def on_disconnect(self) -> None: ...
def can_read(self, timeout: float | None) -> bool: ...
def read_from_socket(self, timeout: float | None = ..., raise_on_timeout: bool = ...) -> bool: ...
def read_response(self, disable_decoding: bool = ...) -> Any: ... # `str | bytes` or `list[str | bytes]`
def read_from_socket(self, timeout: float | None = ..., raise_on_timeout: bool = True) -> bool: ...
def read_response(self, disable_decoding: bool = False) -> Any: ... # `str | bytes` or `list[str | bytes]`
DefaultParser: type[BaseParser] # Hiredis or PythonParser
@@ -79,7 +79,7 @@ class Encoder:
decode_responses: bool
def __init__(self, encoding: str, encoding_errors: str, decode_responses: bool) -> None: ...
def encode(self, value: _Encodable) -> bytes: ...
def decode(self, value: str | bytes | memoryview, force: bool = ...) -> str: ...
def decode(self, value: str | bytes | memoryview, force: bool = False) -> str: ...
class AbstractConnection:
pid: int
@@ -182,18 +182,18 @@ class SSLConnection(Connection):
ssl_ocsp_expected_cert: Incomplete | None # added in 4.1.1
def __init__(
self,
ssl_keyfile=...,
ssl_certfile=...,
ssl_cert_reqs=...,
ssl_ca_certs=...,
ssl_ca_data: Incomplete | None = ...,
ssl_check_hostname: bool = ...,
ssl_ca_path: Incomplete | None = ...,
ssl_password: Incomplete | None = ...,
ssl_validate_ocsp: bool = ...,
ssl_validate_ocsp_stapled: bool = ..., # added in 4.1.1
ssl_ocsp_context: Incomplete | None = ..., # added in 4.1.1
ssl_ocsp_expected_cert: Incomplete | None = ..., # added in 4.1.1
ssl_keyfile=None,
ssl_certfile=None,
ssl_cert_reqs="required",
ssl_ca_certs=None,
ssl_ca_data: Incomplete | None = None,
ssl_check_hostname: bool = False,
ssl_ca_path: Incomplete | None = None,
ssl_password: Incomplete | None = None,
ssl_validate_ocsp: bool = False,
ssl_validate_ocsp_stapled: bool = False, # added in 4.1.1
ssl_ocsp_context: Incomplete | None = None, # added in 4.1.1
ssl_ocsp_expected_cert: Incomplete | None = None, # added in 4.1.1
*,
host: str = "localhost",
port: int = 6379,
@@ -254,13 +254,13 @@ class ConnectionPool:
@classmethod
def from_url(cls, url: str, *, db: int = ..., decode_components: bool = ..., **kwargs) -> Self: ...
def __init__(
self, connection_class: type[Connection] = ..., max_connections: int | None = ..., **connection_kwargs
self, connection_class: type[Connection] = ..., max_connections: int | None = None, **connection_kwargs
) -> None: ...
def reset(self) -> None: ...
def get_connection(self, command_name: Unused, *keys, **options: _ConnectionPoolOptions) -> Connection: ...
def make_connection(self) -> Connection: ...
def release(self, connection: Connection) -> None: ...
def disconnect(self, inuse_connections: bool = ...) -> None: ...
def disconnect(self, inuse_connections: bool = True) -> None: ...
def get_encoder(self) -> Encoder: ...
def owns_connection(self, connection: Connection) -> bool: ...
@@ -270,8 +270,8 @@ class BlockingConnectionPool(ConnectionPool):
pool: Queue[Connection | None] # might not be defined
def __init__(
self,
max_connections: int = ...,
timeout: float = ...,
max_connections: int = 50,
timeout: float = 20,
connection_class: type[Connection] = ...,
queue_class: type[Queue[Any]] = ...,
**connection_kwargs,

View File

@@ -2,4 +2,4 @@ from redis.typing import EncodedT
REDIS_CLUSTER_HASH_SLOTS: int
def key_slot(key: EncodedT, bucket: int = ...) -> int: ...
def key_slot(key: EncodedT, bucket: int = 16384) -> int: ...

View File

@@ -7,5 +7,5 @@ class CredentialProvider:
class UsernamePasswordCredentialProvider(CredentialProvider):
username: str
password: str
def __init__(self, username: str | None = ..., password: str | None = ...) -> None: ...
def __init__(self, username: str | None = None, password: str | None = None) -> None: ...
def get_credentials(self) -> tuple[str] | tuple[str, str]: ...

View File

@@ -27,11 +27,11 @@ class Lock:
self,
redis: Redis[Any],
name: str,
timeout: float | None = ...,
sleep: float = ...,
blocking: bool = ...,
blocking_timeout: float | None = ...,
thread_local: bool = ...,
timeout: float | None = None,
sleep: float = 0.1,
blocking: bool = True,
blocking_timeout: float | None = None,
thread_local: bool = True,
) -> None: ...
def register_scripts(self) -> None: ...
def __enter__(self) -> Self: ...
@@ -40,17 +40,17 @@ class Lock:
) -> bool | None: ...
def acquire(
self,
sleep: float | None = ...,
blocking: bool | None = ...,
blocking_timeout: float | None = ...,
token: str | bytes | None = ...,
sleep: float | None = None,
blocking: bool | None = None,
blocking_timeout: float | None = None,
token: str | bytes | None = None,
) -> bool: ...
def do_acquire(self, token: str | bytes) -> bool: ...
def locked(self) -> bool: ...
def owned(self) -> bool: ...
def release(self) -> None: ...
def do_release(self, expected_token: str | bytes) -> None: ...
def extend(self, additional_time: float, replace_ttl: bool = ...) -> bool: ...
def extend(self, additional_time: float, replace_ttl: bool = False) -> bool: ...
def do_extend(self, additional_time: float, replace_ttl: bool) -> bool: ...
def reacquire(self) -> bool: ...
def do_reacquire(self) -> bool: ...

View File

@@ -5,14 +5,14 @@ from typing_extensions import Literal
from cryptography.x509.base import Certificate
from OpenSSL.SSL import Connection
def ocsp_staple_verifier(con: Connection, ocsp_bytes: bytes, expected: bytes | None = ...) -> Literal[True]: ...
def ocsp_staple_verifier(con: Connection, ocsp_bytes: bytes, expected: bytes | None = None) -> Literal[True]: ...
class OCSPVerifier:
SOCK: SSLObject | SSLSocket
HOST: str
PORT: int
CA_CERTS: str | None
def __init__(self, sock: SSLObject | SSLSocket, host: str, port: int, ca_certs: str | None = ...) -> None: ...
def __init__(self, sock: SSLObject | SSLSocket, host: str, port: int, ca_certs: str | None = None) -> None: ...
# cryptography.x509.general_name.GeneralName.value is typed as Any
def components_from_socket(self) -> tuple[Certificate, Incomplete | None, Incomplete]: ...
def components_from_direct_connection(self) -> tuple[Certificate, Incomplete | None, Incomplete]: ...

View File

@@ -20,7 +20,7 @@ class SentinelManagedConnection(Connection):
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 = ...) -> Any: ...
def read_response(self, disable_decoding: bool = False) -> Any: ...
class SentinelManagedSSLConnection(SentinelManagedConnection, SSLConnection): ...
@@ -43,8 +43,8 @@ class Sentinel(SentinelCommands):
def __init__(
self,
sentinels: Iterable[_AddressAndPort],
min_other_sentinels: int = ...,
sentinel_kwargs: dict[str, Any] | None = ...,
min_other_sentinels: int = 0,
sentinel_kwargs: dict[str, Any] | None = None,
**connection_kwargs,
) -> None: ...
def check_master_state(self, state: _SentinelState, service_name: str) -> bool: ...

View File

@@ -14,7 +14,7 @@ CRYPTOGRAPHY_AVAILABLE: bool
@overload
def from_url(url: str, *, db: int = ..., decode_responses: Literal[True], **kwargs: Any) -> Redis[str]: ...
@overload
def from_url(url: str, *, db: int = ..., decode_responses: Literal[False] = ..., **kwargs: Any) -> Redis[bytes]: ...
def from_url(url: str, *, db: int = ..., decode_responses: Literal[False] = False, **kwargs: Any) -> Redis[bytes]: ...
def pipeline(redis_obj: Redis[_StrType]) -> AbstractContextManager[Pipeline[_StrType]]: ...
def str_if_bytes(value: str | bytes) -> str: ...
def safe_str(value: object) -> str: ...