Skip to content
Merged
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
8 changes: 6 additions & 2 deletions redisvl/index/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def __init__(
self._connection_kwargs = connection_kwargs or {}
self._lock = threading.Lock()

self._validated_client = False
self._validated_client = kwargs.pop("_client_validated", False)
self._owns_redis_client = redis_client is None
if self._owns_redis_client:
weakref.finalize(self, self.disconnect)
Expand Down Expand Up @@ -449,6 +449,8 @@ def from_existing(
elif redis_client:
# Validate client type and set lib name
RedisConnectionFactory.validate_sync_redis(redis_client)
# Mark that client was already validated to avoid duplicate calls
kwargs["_client_validated"] = True

if not redis_client:
raise ValueError("Must provide either a redis_url or redis_client")
Expand Down Expand Up @@ -1163,7 +1165,7 @@ def __init__(
self._connection_kwargs = connection_kwargs or {}
self._lock = asyncio.Lock()

self._validated_client = False
self._validated_client = kwargs.pop("_client_validated", False)
self._owns_redis_client = redis_client is None
if self._owns_redis_client:
weakref.finalize(self, sync_wrapper(self.disconnect))
Expand Down Expand Up @@ -1199,6 +1201,8 @@ async def from_existing(
elif redis_client:
# Validate client type and set lib name
await RedisConnectionFactory.validate_async_redis(redis_client)
# Mark that client was already validated to avoid duplicate calls
kwargs["_client_validated"] = True

if redis_client is None:
raise ValueError(
Expand Down