Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion redis/asyncio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def from_url(
single_connection_client: bool = False,
auto_close_connection_pool: Optional[bool] = None,
**kwargs,
):
) -> "Redis":
"""
Return a Redis client object configured from the given URL

Expand Down
4 changes: 2 additions & 2 deletions redis/asyncio/utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
from redis.asyncio.client import Pipeline, Redis


def from_url(url, **kwargs):
def from_url(url: str, **kwargs: Any) -> "Redis":
"""
Returns an active Redis client generated from the given database URL.

Expand Down
2 changes: 1 addition & 1 deletion redis/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def replace_default_node(self, target_node: "ClusterNode" = None) -> None:

class RedisCluster(AbstractRedisCluster, RedisClusterCommands):
@classmethod
def from_url(cls, url, **kwargs):
def from_url(cls, url: str, **kwargs: Any) -> "RedisCluster":
"""
Return a Redis client object configured from the given URL

Expand Down
7 changes: 5 additions & 2 deletions redis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
from collections.abc import Callable
from contextlib import contextmanager
from functools import wraps
from typing import Any, Dict, List, Mapping, Optional, TypeVar, Union
from typing import TYPE_CHECKING, Any, Dict, List, Mapping, Optional, TypeVar, Union

from redis.exceptions import DataError
from redis.typing import AbsExpiryT, EncodableT, ExpiryT

if TYPE_CHECKING:
from redis.client import Redis

try:
import hiredis # noqa

Expand Down Expand Up @@ -40,7 +43,7 @@
from importlib import metadata


def from_url(url, **kwargs):
def from_url(url: str, **kwargs: Any) -> "Redis":
"""
Returns an active Redis client generated from the given database URL.

Expand Down
Loading