Skip to content

Commit cd37fe9

Browse files
committed
old man yells at mypy emoji
1 parent 3198840 commit cd37fe9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

redisvl/extensions/llmcache/semantic.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,14 @@ def _modify_schema(
186186
async def _get_async_index(self) -> AsyncSearchIndex:
187187
"""Lazily construct the async search index class."""
188188
# Construct async index if necessary
189-
if not self._aindex:
189+
async_client = None
190+
if self._aindex is None:
190191
client = self.redis_kwargs.get("redis_client")
191-
if client and isinstance(client, Redis):
192-
client = RedisConnectionFactory.sync_to_async_redis(client)
192+
if isinstance(client, Redis):
193+
async_client = RedisConnectionFactory.sync_to_async_redis(client)
193194
self._aindex = AsyncSearchIndex(
194195
schema=self._index.schema,
195-
redis_client=client,
196+
redis_client=async_client,
196197
redis_url=self.redis_kwargs["redis_url"],
197198
**self.redis_kwargs["connection_kwargs"],
198199
)

0 commit comments

Comments
 (0)