mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Update redis stubs to 4.3 (#8108)
This commit is contained in:
@@ -1 +1 @@
|
||||
version = "4.2.*"
|
||||
version = "4.3.*"
|
||||
|
||||
@@ -3,7 +3,7 @@ from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Mappin
|
||||
from typing import Any, Generic, NoReturn, Protocol
|
||||
from typing_extensions import TypeAlias, TypedDict
|
||||
|
||||
from redis.asyncio.connection import Connection, ConnectionPool
|
||||
from redis.asyncio.connection import ConnectCallbackT, Connection, ConnectionPool
|
||||
from redis.asyncio.lock import Lock
|
||||
from redis.asyncio.retry import Retry
|
||||
from redis.client import AbstractRedis, _StrType
|
||||
@@ -59,6 +59,7 @@ class Redis(AbstractRedis, RedisModuleCommands, AsyncCoreCommands[_StrType], Asy
|
||||
username: str | None = ...,
|
||||
retry: Retry | None = ...,
|
||||
auto_close_connection_pool: bool = ...,
|
||||
redis_connect_func: ConnectCallbackT | None = ...,
|
||||
) -> None: ...
|
||||
def __await__(self): ...
|
||||
async def initialize(self: Self) -> Self: ...
|
||||
|
||||
@@ -113,7 +113,7 @@ class Connection:
|
||||
next_health_check: int
|
||||
ssl_context: Any
|
||||
encoder: Any
|
||||
redis_connect_func: Any
|
||||
redis_connect_func: ConnectCallbackT | None
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
@@ -214,7 +214,7 @@ class UnixDomainSocketConnection(Connection):
|
||||
retry: Any
|
||||
health_check_interval: Any
|
||||
next_health_check: int
|
||||
redis_connect_func: Any
|
||||
redis_connect_func: ConnectCallbackT | None
|
||||
encoder: Any
|
||||
def __init__(
|
||||
self,
|
||||
@@ -234,7 +234,7 @@ class UnixDomainSocketConnection(Connection):
|
||||
health_check_interval: float = ...,
|
||||
client_name: str | None = ...,
|
||||
retry: Retry | None = ...,
|
||||
redis_connect_func: Any | None = ...,
|
||||
redis_connect_func: ConnectCallbackT | None = ...,
|
||||
) -> None: ...
|
||||
def repr_pieces(self) -> Iterable[tuple[str, str | int]]: ...
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import threading
|
||||
from _typeshed import Self, SupportsItems
|
||||
from _typeshed import Incomplete, Self, SupportsItems
|
||||
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
|
||||
from datetime import datetime, timedelta
|
||||
from types import TracebackType
|
||||
@@ -7,9 +7,10 @@ from typing import Any, ClassVar, Generic, Pattern, TypeVar, overload
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
from .commands import CoreCommands, RedisModuleCommands, SentinelCommands
|
||||
from .connection import ConnectionPool, _ConnectionPoolOptions
|
||||
from .connection import ConnectionPool, _ConnectFunc, _ConnectionPoolOptions
|
||||
from .lock import Lock
|
||||
from .retry import Retry
|
||||
from .typing import ChannelT, EncodableT, KeyT, PatternT
|
||||
|
||||
_Value: TypeAlias = bytes | float | int | str
|
||||
_Key: TypeAlias = str | bytes
|
||||
@@ -183,7 +184,7 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands[_StrType], Sentinel
|
||||
client_name: str | None = ...,
|
||||
username: str | None = ...,
|
||||
retry: Retry | None = ...,
|
||||
redis_connect_func: Any | None = ...,
|
||||
redis_connect_func: _ConnectFunc | None = ...,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def __init__(
|
||||
@@ -223,7 +224,7 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands[_StrType], Sentinel
|
||||
client_name: str | None = ...,
|
||||
username: str | None = ...,
|
||||
retry: Retry | None = ...,
|
||||
redis_connect_func: Any | None = ...,
|
||||
redis_connect_func: _ConnectFunc | None = ...,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def __init__(
|
||||
@@ -262,7 +263,7 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands[_StrType], Sentinel
|
||||
client_name: str | None = ...,
|
||||
username: str | None = ...,
|
||||
retry: Retry | None = ...,
|
||||
redis_connect_func: Any | None = ...,
|
||||
redis_connect_func: _ConnectFunc | None = ...,
|
||||
) -> None: ...
|
||||
def get_encoder(self): ...
|
||||
def get_connection_kwargs(self): ...
|
||||
@@ -275,6 +276,7 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands[_StrType], Sentinel
|
||||
name: _Key,
|
||||
timeout: float | None = ...,
|
||||
sleep: float = ...,
|
||||
blocking: bool = ...,
|
||||
blocking_timeout: float | None = ...,
|
||||
lock_class: None = ...,
|
||||
thread_local: bool = ...,
|
||||
@@ -285,6 +287,7 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands[_StrType], Sentinel
|
||||
name: _Key,
|
||||
timeout: float | None,
|
||||
sleep: float,
|
||||
blocking: bool,
|
||||
blocking_timeout: float | None,
|
||||
lock_class: type[_LockType],
|
||||
thread_local: bool = ...,
|
||||
@@ -295,6 +298,7 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands[_StrType], Sentinel
|
||||
name: _Key,
|
||||
timeout: float | None = ...,
|
||||
sleep: float = ...,
|
||||
blocking: bool = ...,
|
||||
blocking_timeout: float | None = ...,
|
||||
*,
|
||||
lock_class: type[_LockType],
|
||||
@@ -397,7 +401,6 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
|
||||
# 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 lock(self, name, timeout=..., sleep=..., blocking_timeout=..., lock_class=..., thread_local=...): ...
|
||||
def acl_cat(self, category: str | 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]
|
||||
@@ -414,6 +417,8 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
|
||||
categories: Sequence[str] | None = ...,
|
||||
commands: Sequence[str] | None = ...,
|
||||
keys: Sequence[str] | None = ...,
|
||||
channels: Iterable[ChannelT] | None = ...,
|
||||
selectors: Iterable[tuple[str, KeyT]] | None = ...,
|
||||
reset: bool = ...,
|
||||
reset_keys: bool = ...,
|
||||
reset_passwords: bool = ...,
|
||||
@@ -429,8 +434,8 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
|
||||
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=...) -> Pipeline[_StrType]: ... # type: ignore[override]
|
||||
def config_set(self, name, value) -> 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]
|
||||
@@ -438,7 +443,7 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
|
||||
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 = ...) -> Pipeline[_StrType]: ... # type: ignore[override]
|
||||
def info(self, section: _Key | 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]
|
||||
@@ -585,10 +590,10 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
|
||||
self, name, groupname, consumername, min_idle_time, message_ids, idle=..., time=..., retrycount=..., force=..., justid=...
|
||||
) -> Pipeline[_StrType]: ... # type: ignore[override]
|
||||
def xdel(self, name, *ids) -> Pipeline[_StrType]: ... # type: ignore[override]
|
||||
def xgroup_create(self, name, groupname, id=..., mkstream=...) -> Pipeline[_StrType]: ... # type: ignore[override]
|
||||
def xgroup_create(self, name, groupname, id=..., mkstream=..., entries_read: int | 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) -> Pipeline[_StrType]: ... # type: ignore[override]
|
||||
def xgroup_setid(self, name, groupname, id, entries_read: int | 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]
|
||||
@@ -599,7 +604,7 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
|
||||
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, approximate: bool = ..., minid: Any | None = ..., limit: int | None = ...) -> 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 zadd( # type: ignore[override]
|
||||
self,
|
||||
name: _Key,
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Callable
|
||||
from threading import Lock
|
||||
from typing import Any, ClassVar, Generic
|
||||
|
||||
from redis.client import PubSub
|
||||
from redis.commands import RedisClusterCommands
|
||||
from redis.commands.core import _StrType
|
||||
from redis.connection import DefaultParser
|
||||
from redis.connection import DefaultParser, Encoder
|
||||
from redis.exceptions import RedisError
|
||||
|
||||
def get_node_name(host, port): ...
|
||||
@@ -43,7 +46,7 @@ class RedisCluster(RedisClusterCommands[_StrType], Generic[_StrType]):
|
||||
node_flags: Any
|
||||
read_from_replicas: Any
|
||||
reinitialize_counter: int
|
||||
reinitialize_steps: Any
|
||||
reinitialize_steps: int
|
||||
nodes_manager: Any
|
||||
cluster_response_callbacks: Any
|
||||
result_callbacks: Any
|
||||
@@ -79,9 +82,18 @@ class RedisCluster(RedisClusterCommands[_StrType], Generic[_StrType]):
|
||||
def monitor(self, target_node: Any | None = ...): ...
|
||||
def pubsub(self, node: Any | None = ..., host: Any | None = ..., port: Any | None = ..., **kwargs): ...
|
||||
def pipeline(self, transaction: Any | None = ..., shard_hint: Any | 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 = ...,
|
||||
): ...
|
||||
def keyslot(self, key): ...
|
||||
def determine_slot(self, *args): ...
|
||||
def reinitialize_caches(self) -> None: ...
|
||||
def get_encoder(self): ...
|
||||
def get_connection_kwargs(self): ...
|
||||
def execute_command(self, *args, **kwargs): ...
|
||||
@@ -139,29 +151,30 @@ class ClusterPubSub(PubSub):
|
||||
def get_redis_connection(self): ...
|
||||
|
||||
class ClusterPipeline(RedisCluster[_StrType], Generic[_StrType]):
|
||||
command_stack: Any
|
||||
nodes_manager: Any
|
||||
command_stack: list[Incomplete]
|
||||
nodes_manager: Incomplete
|
||||
refresh_table_asap: bool
|
||||
result_callbacks: Any
|
||||
startup_nodes: Any
|
||||
read_from_replicas: Any
|
||||
command_flags: Any
|
||||
cluster_response_callbacks: Any
|
||||
cluster_error_retry_attempts: Any
|
||||
result_callbacks: Incomplete
|
||||
startup_nodes: Incomplete
|
||||
read_from_replicas: bool
|
||||
command_flags: Incomplete
|
||||
cluster_response_callbacks: Incomplete
|
||||
cluster_error_retry_attempts: int
|
||||
reinitialize_counter: int
|
||||
reinitialize_steps: Any
|
||||
encoder: Any
|
||||
commands_parser: Any
|
||||
reinitialize_steps: int
|
||||
encoder: Encoder
|
||||
commands_parser: Incomplete
|
||||
def __init__(
|
||||
self,
|
||||
nodes_manager,
|
||||
commands_parser,
|
||||
result_callbacks: Any | None = ...,
|
||||
cluster_response_callbacks: Any | None = ...,
|
||||
startup_nodes: Any | None = ...,
|
||||
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 = ...,
|
||||
**kwargs,
|
||||
) -> None: ...
|
||||
def __enter__(self): ...
|
||||
@@ -189,7 +202,7 @@ class ClusterPipeline(RedisCluster[_StrType], Generic[_StrType]):
|
||||
def script_load_for_pipeline(self, *args, **kwargs) -> None: ...
|
||||
def delete(self, *names): ...
|
||||
|
||||
def block_pipeline_command(func): ...
|
||||
def block_pipeline_command(name: str) -> Callable[..., Any]: ...
|
||||
|
||||
class PipelineCommand:
|
||||
args: Any
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import builtins
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Iterator, Mapping, Sequence
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Any, Generic, TypeVar, overload
|
||||
@@ -6,7 +7,7 @@ from typing_extensions import Literal
|
||||
|
||||
from ..asyncio.client import Redis as AsyncRedis
|
||||
from ..client import _CommandOptions, _Key, _Value
|
||||
from ..typing import EncodableT, KeyT, ScriptTextT
|
||||
from ..typing import ChannelT, EncodableT, KeyT, PatternT, ScriptTextT
|
||||
|
||||
_ScoreCastFuncReturn = TypeVar("_ScoreCastFuncReturn")
|
||||
_StrType = TypeVar("_StrType", bound=str | bytes)
|
||||
@@ -32,6 +33,8 @@ class ACLCommands(Generic[_StrType]):
|
||||
categories: Sequence[str] | None = ...,
|
||||
commands: Sequence[str] | None = ...,
|
||||
keys: Sequence[str] | None = ...,
|
||||
channels: Iterable[ChannelT] | None = ...,
|
||||
selectors: Iterable[tuple[str, KeyT]] | None = ...,
|
||||
reset: bool = ...,
|
||||
reset_keys: bool = ...,
|
||||
reset_passwords: bool = ...,
|
||||
@@ -61,6 +64,8 @@ class AsyncACLCommands(Generic[_StrType]):
|
||||
categories: Sequence[str] | None = ...,
|
||||
commands: Sequence[str] | None = ...,
|
||||
keys: Sequence[str] | None = ...,
|
||||
channels: Iterable[ChannelT] | None = ...,
|
||||
selectors: Iterable[tuple[str, KeyT]] | None = ...,
|
||||
reset: bool = ...,
|
||||
reset_keys: bool = ...,
|
||||
reset_passwords: bool = ...,
|
||||
@@ -117,8 +122,8 @@ class ManagementCommands:
|
||||
def command(self, **kwargs: _CommandOptions): ...
|
||||
def command_info(self, **kwargs: _CommandOptions): ...
|
||||
def command_count(self, **kwargs: _CommandOptions): ...
|
||||
def config_get(self, pattern: str = ..., **kwargs: _CommandOptions): ...
|
||||
def config_set(self, name, value, **kwargs: _CommandOptions): ...
|
||||
def config_get(self, pattern: PatternT = ..., *args: PatternT, **kwargs: _CommandOptions): ...
|
||||
def config_set(self, name: KeyT, value: EncodableT, *args: KeyT | EncodableT, **kwargs: _CommandOptions): ...
|
||||
def config_resetstat(self, **kwargs: _CommandOptions): ...
|
||||
def config_rewrite(self, **kwargs: _CommandOptions): ...
|
||||
def dbsize(self, **kwargs: _CommandOptions) -> int: ...
|
||||
@@ -131,7 +136,7 @@ class ManagementCommands:
|
||||
def psync(self, replicationid, offset): ...
|
||||
def swapdb(self, first, second, **kwargs: _CommandOptions): ...
|
||||
def select(self, index, **kwargs: _CommandOptions): ...
|
||||
def info(self, section: _Key | None = ..., **kwargs: _CommandOptions) -> Mapping[str, Any]: ...
|
||||
def info(self, section: _Key | None = ..., *args: _Key, **kwargs: _CommandOptions) -> Mapping[str, Any]: ...
|
||||
def lastsave(self, **kwargs: _CommandOptions): ...
|
||||
def lolwut(self, *version_numbers: _Value, **kwargs: _CommandOptions) -> bytes: ...
|
||||
def reset(self) -> None: ...
|
||||
@@ -158,7 +163,15 @@ class ManagementCommands:
|
||||
def quit(self, **kwargs: _CommandOptions): ...
|
||||
def replicaof(self, *args, **kwargs: _CommandOptions): ...
|
||||
def save(self, **kwargs: _CommandOptions) -> bool: ...
|
||||
def shutdown(self, save: bool = ..., nosave: bool = ..., **kwargs: _CommandOptions) -> None: ...
|
||||
def shutdown(
|
||||
self,
|
||||
save: bool = ...,
|
||||
nosave: bool = ...,
|
||||
now: bool = ...,
|
||||
force: bool = ...,
|
||||
abort: bool = ...,
|
||||
**kwargs: _CommandOptions,
|
||||
) -> None: ...
|
||||
def slaveof(self, host: Any | None = ..., port: Any | None = ..., **kwargs: _CommandOptions): ...
|
||||
def slowlog_get(self, num: Any | None = ..., **kwargs: _CommandOptions): ...
|
||||
def slowlog_len(self, **kwargs: _CommandOptions): ...
|
||||
@@ -214,8 +227,8 @@ class AsyncManagementCommands:
|
||||
async def command(self, **kwargs: _CommandOptions): ...
|
||||
async def command_info(self, **kwargs: _CommandOptions): ...
|
||||
async def command_count(self, **kwargs: _CommandOptions): ...
|
||||
async def config_get(self, pattern: str = ..., **kwargs: _CommandOptions): ...
|
||||
async def config_set(self, name, value, **kwargs: _CommandOptions): ...
|
||||
async def config_get(self, pattern: PatternT = ..., *args: PatternT, **kwargs: _CommandOptions): ...
|
||||
async def config_set(self, name: KeyT, value: EncodableT, *args: KeyT | EncodableT, **kwargs: _CommandOptions): ...
|
||||
async def config_resetstat(self, **kwargs: _CommandOptions): ...
|
||||
async def config_rewrite(self, **kwargs: _CommandOptions): ...
|
||||
async def dbsize(self, **kwargs: _CommandOptions) -> int: ...
|
||||
@@ -228,7 +241,7 @@ class AsyncManagementCommands:
|
||||
async def psync(self, replicationid, offset): ...
|
||||
async def swapdb(self, first, second, **kwargs: _CommandOptions): ...
|
||||
async def select(self, index, **kwargs: _CommandOptions): ...
|
||||
async def info(self, section: _Key | None = ..., **kwargs: _CommandOptions) -> Mapping[str, Any]: ...
|
||||
async def info(self, section: _Key | None = ..., *args: _Key, **kwargs: _CommandOptions) -> Mapping[str, Any]: ...
|
||||
async def lastsave(self, **kwargs: _CommandOptions): ...
|
||||
async def lolwut(self, *version_numbers: _Value, **kwargs: _CommandOptions) -> bytes: ...
|
||||
async def reset(self) -> None: ...
|
||||
@@ -255,7 +268,15 @@ class AsyncManagementCommands:
|
||||
async def quit(self, **kwargs: _CommandOptions): ...
|
||||
async def replicaof(self, *args, **kwargs: _CommandOptions): ...
|
||||
async def save(self, **kwargs: _CommandOptions) -> bool: ...
|
||||
async def shutdown(self, save: bool = ..., nosave: bool = ..., **kwargs: _CommandOptions) -> None: ...
|
||||
async def shutdown(
|
||||
self,
|
||||
save: bool = ...,
|
||||
nosave: bool = ...,
|
||||
now: bool = ...,
|
||||
force: bool = ...,
|
||||
abort: bool = ...,
|
||||
**kwargs: _CommandOptions,
|
||||
) -> None: ...
|
||||
async def slaveof(self, host: Any | None = ..., port: Any | None = ..., **kwargs: _CommandOptions): ...
|
||||
async def slowlog_get(self, num: Any | None = ..., **kwargs: _CommandOptions): ...
|
||||
async def slowlog_len(self, **kwargs: _CommandOptions): ...
|
||||
@@ -803,11 +824,11 @@ class StreamCommands:
|
||||
self, name, groupname, consumername, min_idle_time, message_ids, idle=..., time=..., retrycount=..., force=..., justid=...
|
||||
): ...
|
||||
def xdel(self, name, *ids): ...
|
||||
def xgroup_create(self, name, groupname, id: str = ..., mkstream: bool = ...): ...
|
||||
def xgroup_create(self, name, groupname, id: str = ..., mkstream: bool = ..., entries_read: int | None = ...): ...
|
||||
def xgroup_delconsumer(self, name, groupname, consumername): ...
|
||||
def xgroup_destroy(self, name, groupname): ...
|
||||
def xgroup_createconsumer(self, name, groupname, consumername): ...
|
||||
def xgroup_setid(self, name, groupname, id): ...
|
||||
def xgroup_setid(self, name, groupname, id, entries_read: int | None = ...): ...
|
||||
def xinfo_consumers(self, name, groupname): ...
|
||||
def xinfo_groups(self, name): ...
|
||||
def xinfo_stream(self, name, full: bool = ...): ...
|
||||
@@ -822,7 +843,9 @@ class StreamCommands:
|
||||
self, groupname, consumername, streams, count: Any | None = ..., block: Any | None = ..., noack: bool = ...
|
||||
): ...
|
||||
def xrevrange(self, name, max: str = ..., min: str = ..., count: Any | None = ...): ...
|
||||
def xtrim(self, name, maxlen: int, approximate: bool = ..., minid: Any | None = ..., limit: Any | None = ...): ...
|
||||
def xtrim(
|
||||
self, name, maxlen: int | None = ..., approximate: bool = ..., minid: Incomplete | None = ..., limit: int | None = ...
|
||||
): ...
|
||||
|
||||
class AsyncStreamCommands:
|
||||
async def xack(self, name, groupname, *ids): ...
|
||||
@@ -844,11 +867,11 @@ class AsyncStreamCommands:
|
||||
self, name, groupname, consumername, min_idle_time, message_ids, idle=..., time=..., retrycount=..., force=..., justid=...
|
||||
): ...
|
||||
async def xdel(self, name, *ids): ...
|
||||
async def xgroup_create(self, name, groupname, id: str = ..., mkstream: bool = ...): ...
|
||||
async def xgroup_create(self, name, groupname, id: str = ..., mkstream: bool = ..., entries_read: int | None = ...): ...
|
||||
async def xgroup_delconsumer(self, name, groupname, consumername): ...
|
||||
async def xgroup_destroy(self, name, groupname): ...
|
||||
async def xgroup_createconsumer(self, name, groupname, consumername): ...
|
||||
async def xgroup_setid(self, name, groupname, id): ...
|
||||
async def xgroup_setid(self, name, groupname, id, entries_read: int | None = ...): ...
|
||||
async def xinfo_consumers(self, name, groupname): ...
|
||||
async def xinfo_groups(self, name): ...
|
||||
async def xinfo_stream(self, name, full: bool = ...): ...
|
||||
@@ -863,7 +886,9 @@ class AsyncStreamCommands:
|
||||
self, groupname, consumername, streams, count: Any | None = ..., block: Any | None = ..., noack: bool = ...
|
||||
): ...
|
||||
async def xrevrange(self, name, max: str = ..., min: str = ..., count: Any | None = ...): ...
|
||||
async def xtrim(self, name, maxlen: int, approximate: bool = ..., minid: Any | None = ..., limit: Any | None = ...): ...
|
||||
async def xtrim(
|
||||
self, name, maxlen: int | None = ..., approximate: bool = ..., minid: Incomplete | None = ..., limit: int | None = ...
|
||||
): ...
|
||||
|
||||
class SortedSetCommands(Generic[_StrType]):
|
||||
def zadd(
|
||||
@@ -1541,9 +1566,7 @@ class AsyncClusterCommands:
|
||||
async def readonly(self, **kwargs: _CommandOptions) -> bool: ...
|
||||
|
||||
class FunctionCommands:
|
||||
def function_load(
|
||||
self, engine: str, library: str, code: str, replace: bool | None = ..., description: str | None = ...
|
||||
) -> Awaitable[str] | str: ...
|
||||
def function_load(self, code: str, replace: bool | None = ...) -> Awaitable[str] | str: ...
|
||||
def function_delete(self, library: str) -> Awaitable[str] | str: ...
|
||||
def function_flush(self, mode: str = ...) -> Awaitable[str] | str: ...
|
||||
def function_list(self, library: str | None = ..., withcode: bool | None = ...) -> Awaitable[list[Any]] | list[Any]: ...
|
||||
@@ -1555,9 +1578,7 @@ class FunctionCommands:
|
||||
def function_stats(self) -> Awaitable[list[Any]] | list[Any]: ...
|
||||
|
||||
class AsyncFunctionCommands:
|
||||
async def function_load(
|
||||
self, engine: str, library: str, code: str, replace: bool | None = ..., description: str | None = ...
|
||||
) -> Awaitable[str] | str: ...
|
||||
async def function_load(self, code: str, replace: bool | None = ...) -> Awaitable[str] | str: ...
|
||||
async def function_delete(self, library: str) -> Awaitable[str] | str: ...
|
||||
async def function_flush(self, mode: str = ...) -> Awaitable[str] | str: ...
|
||||
async def function_list(self, library: str | None = ..., withcode: bool | None = ...) -> Awaitable[list[Any]] | list[Any]: ...
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Mapping
|
||||
from typing import Any
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
@@ -87,13 +88,15 @@ class SearchCommands:
|
||||
def explain(self, query: str | Query, query_params: _QueryParams | None = ...): ...
|
||||
def explain_cli(self, query): ...
|
||||
def aggregate(self, query: AggregateRequest | Cursor, query_params: _QueryParams | None = ...) -> AggregateResult: ...
|
||||
def profile(self, query, limited: bool = ...): ...
|
||||
def profile(
|
||||
self, query: str | Query | AggregateRequest, limited: bool = ..., query_params: Mapping[str, str | float] | None = ...
|
||||
) -> tuple[Incomplete, Incomplete]: ...
|
||||
def spellcheck(self, query, distance: Any | None = ..., include: Any | None = ..., exclude: Any | None = ...): ...
|
||||
def dict_add(self, name, *terms): ...
|
||||
def dict_del(self, name, *terms): ...
|
||||
def dict_dump(self, name): ...
|
||||
def config_set(self, option, value): ...
|
||||
def config_get(self, option): ...
|
||||
def config_set(self, option: str, value: str) -> bool: ...
|
||||
def config_get(self, option: str) -> dict[str, str]: ...
|
||||
def tagvals(self, tagfield): ...
|
||||
def aliasadd(self, alias): ...
|
||||
def aliasupdate(self, alias): ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from _typeshed import Self
|
||||
from collections.abc import Mapping
|
||||
from collections.abc import Callable, Mapping
|
||||
from typing import Any
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
@@ -14,6 +14,7 @@ SERVER_CLOSED_CONNECTION_ERROR: Any
|
||||
|
||||
# Options as passed to Pool.get_connection().
|
||||
_ConnectionPoolOptions: TypeAlias = Any
|
||||
_ConnectFunc: TypeAlias = Callable[[Connection], object]
|
||||
|
||||
class BaseParser:
|
||||
EXCEPTION_CLASSES: Any
|
||||
@@ -76,7 +77,7 @@ class Connection:
|
||||
encoding_errors: Any
|
||||
decode_responses: Any
|
||||
retry: Retry
|
||||
redis_connect_func: Any | None
|
||||
redis_connect_func: _ConnectFunc | None
|
||||
def __init__(
|
||||
self,
|
||||
host: str = ...,
|
||||
@@ -99,7 +100,7 @@ class Connection:
|
||||
client_name: str | None = ...,
|
||||
username: str | None = ...,
|
||||
retry: Retry | None = ...,
|
||||
redis_connect_func: Any | None = ...,
|
||||
redis_connect_func: _ConnectFunc | None = ...,
|
||||
) -> None: ...
|
||||
def __del__(self): ...
|
||||
def register_connect_callback(self, callback): ...
|
||||
@@ -176,7 +177,7 @@ class UnixDomainSocketConnection(Connection):
|
||||
health_check_interval: int = ...,
|
||||
client_name=...,
|
||||
retry: Retry | None = ...,
|
||||
redis_connect_func: Any | None = ...,
|
||||
redis_connect_func: _ConnectFunc | None = ...,
|
||||
) -> None: ...
|
||||
def repr_pieces(self) -> list[tuple[str, str]]: ...
|
||||
|
||||
|
||||
@@ -31,7 +31,12 @@ class Lock:
|
||||
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
|
||||
) -> bool | None: ...
|
||||
def acquire(
|
||||
self, blocking: bool | None = ..., blocking_timeout: float | None = ..., token: str | bytes | None = ...
|
||||
self,
|
||||
*,
|
||||
sleep: float | None = ...,
|
||||
blocking: bool | None = ...,
|
||||
blocking_timeout: float | None = ...,
|
||||
token: str | bytes | None = ...,
|
||||
) -> bool: ...
|
||||
def do_acquire(self, token: str | bytes) -> bool: ...
|
||||
def locked(self) -> bool: ...
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
from collections.abc import Iterable
|
||||
|
||||
class Retry:
|
||||
def __init__(self, backoff, retries, supported_errors=...) -> None: ...
|
||||
def update_supported_erros(self, specified_errors) -> None: ...
|
||||
def update_supported_errors(self, specified_errors: Iterable[Exception]) -> None: ...
|
||||
def call_with_retry(self, do, fail): ...
|
||||
|
||||
Reference in New Issue
Block a user