Skip to content

Commit 5e5628c

Browse files
committed
black/ruff
1 parent 80bd01f commit 5e5628c

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

django_valkey/async_cache/client/default.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919

2020
if TYPE_CHECKING:
2121
from django_valkey.async_cache.cache import AsyncValkeyCache
22-
from django_valkey.async_cache.pool import AsyncConnectionFactory, AsyncSentinelConnectionFactory
22+
from django_valkey.async_cache.pool import (
23+
AsyncConnectionFactory,
24+
AsyncSentinelConnectionFactory,
25+
)
2326

2427

2528
async def glove_escape(s: str) -> str:
@@ -56,7 +59,9 @@ def __init__(
5659
"DJANGO_VALKEY_CONNECTION_FACTORY",
5760
"django_valkey.async_cache.pool.AsyncConnectionFactory",
5861
)
59-
self.connection_factory: AsyncConnectionFactory | AsyncSentinelConnectionFactory | Any = pool.get_connection_factory(
62+
self.connection_factory: (
63+
AsyncConnectionFactory | AsyncSentinelConnectionFactory | Any
64+
) = pool.get_connection_factory(
6065
options=self._options, path=self._connection_factory
6166
)
6267

django_valkey/async_cache/pool.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from valkey.asyncio.sentinel import Sentinel
1010
from valkey._parsers.url_parser import to_bool
1111

12-
from django_valkey.base_pool import BaseConnectionPool, Base, Pool
12+
from django_valkey.base_pool import BaseConnectionPool
1313

1414

1515
class AsyncConnectionFactory(BaseConnectionPool[AValkey, ConnectionPool]):
@@ -31,8 +31,9 @@ async def connect(self, url: str) -> AValkey | Any:
3131

3232
async def get_connection(self, params: dict) -> AValkey | Any:
3333
pool = self.get_or_create_connection_pool(params)
34-
return await self.base_client_cls(connection_pool=pool, **self.base_client_cls_kwargs)
35-
34+
return await self.base_client_cls(
35+
connection_pool=pool, **self.base_client_cls_kwargs
36+
)
3637

3738

3839
class AsyncSentinelConnectionFactory(AsyncConnectionFactory):

django_valkey/pool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ def get_parser_cls(self) -> type[DefaultParser] | type:
3030
return DefaultParser
3131
return import_string(cls)
3232

33-
def connect(self, url :str) -> Valkey | Any:
33+
def connect(self, url: str) -> Valkey | Any:
3434
params = self.make_connection_params(url)
3535
return self.get_connection(params)
3636

3737
def get_connection(self, params: dict) -> Base | Any:
3838
pool = self.get_or_create_connection_pool(params)
3939
return self.base_client_cls(connection_pool=pool, **self.base_client_cls_kwargs)
4040

41+
4142
class SentinelConnectionFactory(ConnectionFactory):
4243
def __init__(self, options: dict):
4344
# allow overriding the default SentinelConnectionPool class

0 commit comments

Comments
 (0)