Skip to content

Commit c199968

Browse files
committed
Format, lint
1 parent c2bf280 commit c199968

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

redisvl/extensions/llmcache/semantic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ async def _get_async_index(self) -> AsyncSearchIndex:
180180
schema=self._index.schema,
181181
redis_client=self.redis_kwargs["redis_client"],
182182
redis_url=self.redis_kwargs["redis_url"],
183-
**self.redis_kwargs["connection_kwargs"]
183+
**self.redis_kwargs["connection_kwargs"],
184184
)
185185
return self._aindex
186186

redisvl/index/index.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import atexit
33
import json
44
import threading
5+
import warnings
56
from functools import wraps
67
from typing import (
78
TYPE_CHECKING,
@@ -16,7 +17,7 @@
1617
Union,
1718
cast,
1819
)
19-
import warnings
20+
2021
from redisvl.utils.utils import deprecated_function
2122

2223
if TYPE_CHECKING:

redisvl/redis/connection.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,17 @@ def get_async_redis_connection(url: Optional[str] = None, **kwargs) -> AsyncRedi
261261
# fallback to env var REDIS_URL
262262
return AsyncRedis.from_url(get_address_from_env(), **kwargs)
263263

264-
@deprecated_function("sync_to_async_redis", "Please use an async Redis client instead.")
264+
@deprecated_function(
265+
"sync_to_async_redis", "Please use an async Redis client instead."
266+
)
265267
@staticmethod
266268
def sync_to_async_redis(redis_client: Redis) -> AsyncRedis:
267269
# pick the right connection class
268270
connection_class: Type[AbstractConnection] = (
269271
AsyncSSLConnection
270272
if redis_client.connection_pool.connection_class == SSLConnection
271273
else AsyncConnection
272-
) # type: ignore
274+
) # type: ignore
273275
# make async client
274276
return AsyncRedis.from_pool( # type: ignore
275277
AsyncConnectionPool(

redisvl/utils/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,13 @@ def deprecated_function(name: Optional[str] = None, replacement: Optional[str] =
9797
When the wrapped function is called, the decorator will log a deprecation
9898
warning.
9999
"""
100+
100101
def decorator(func):
101102
fn_name = name or func.__name__
102-
warning_message = f"Function {fn_name} is deprecated and will be " \
103+
warning_message = (
104+
f"Function {fn_name} is deprecated and will be "
103105
"removed in the next major release. "
106+
)
104107
if replacement:
105108
warning_message += replacement
106109

tests/unit/test_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ async def test_func(dtype=None, vectorizer=None):
239239
assert result == 1
240240

241241

242-
243242
class TestDeprecatedFunction:
244243
def test_deprecated_function_warning(self):
245244
@deprecated_function("new_func", "Use new_func2")

0 commit comments

Comments
 (0)