Skip to content

Commit 9e9b68c

Browse files
committed
Removed redundant references
1 parent 65bd5af commit 9e9b68c

File tree

5 files changed

+4
-10
lines changed

5 files changed

+4
-10
lines changed

redis/asyncio/client.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
cast,
2727
)
2828

29-
from cachetools import Cache
3029
from redis._parsers.helpers import (
3130
_RedisCallbacks,
3231
_RedisCallbacksRESP2,
@@ -652,9 +651,6 @@ async def parse_response(
652651
return await retval if inspect.isawaitable(retval) else retval
653652
return response
654653

655-
def get_cache(self) -> Optional[Cache]:
656-
return self.connection_pool.cache
657-
658654

659655
StrictRedis = Redis
660656

redis/client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from itertools import chain
77
from typing import Any, Callable, Dict, List, Optional, Type, Union
88

9-
from cachetools import Cache
109
from redis._parsers.encoders import Encoder
1110
from redis._parsers.helpers import (
1211
_RedisCallbacks,

redis/cluster.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from collections import OrderedDict
77
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
88

9-
from cachetools import Cache
109
from redis._parsers import CommandsParser, Encoder
1110
from redis._parsers.helpers import parse_scan
1211
from redis.backoff import default_backoff
@@ -1335,7 +1334,7 @@ def __init__(
13351334
connection_pool_class=ConnectionPool,
13361335
address_remap: Optional[Callable[[Tuple[str, int]], Tuple[str, int]]] = None,
13371336
use_cache: bool = False,
1338-
cache: Optional[Cache] = None,
1337+
cache: Optional[CacheInterface] = None,
13391338
cache_eviction: Optional[EvictionPolicy] = None,
13401339
cache_size: int = 128,
13411340
cache_ttl: int = 300,

redis/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from urllib.parse import parse_qs, unquote, urlparse
1414

1515
from apscheduler.schedulers.background import BackgroundScheduler
16-
from cachetools import Cache, LRUCache
16+
from cachetools import LRUCache
1717
from cachetools.keys import hashkey
1818
from redis.cache import (
1919
CacheConfiguration,

tests/test_cache.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest
55
import redis
66
from cachetools import LFUCache, LRUCache, TTLCache
7-
from redis.cache import CacheToolsAdapter, EvictionPolicy, EvictionPolicyCacheClass
7+
from redis.cache import CacheToolsAdapter, EvictionPolicy
88
from redis.utils import HIREDIS_AVAILABLE
99
from tests.conftest import _get_client, skip_if_resp_version
1010

@@ -973,7 +973,7 @@ def test_cache_clears_on_disconnect(self, master, cache):
973973

974974
@pytest.mark.skipif(HIREDIS_AVAILABLE, reason="PythonParser only")
975975
@pytest.mark.onlynoncluster
976-
# @skip_if_resp_version(2)
976+
@skip_if_resp_version(2)
977977
class TestSSLCache:
978978
@pytest.mark.parametrize(
979979
"r",

0 commit comments

Comments
 (0)