@@ -145,8 +145,8 @@ def check_vector_capabilities(client: SyncRedisClient) -> VectorSupport:
145145 Returns:
146146 VectorSupport with version info and supported features
147147 """
148- info = client .info ("server" )
149- redis_version = info .get ("redis_version" , "0.0.0" )
148+ info = client .info ("server" ) # type: ignore[union-attr]
149+ redis_version = info .get ("redis_version" , "0.0.0" ) # type: ignore[union-attr]
150150
151151 modules = RedisConnectionFactory .get_modules (client )
152152 search_ver = modules .get ("search" , 0 )
@@ -173,8 +173,8 @@ async def check_vector_capabilities_async(client: AsyncRedisClient) -> VectorSup
173173 Returns:
174174 VectorSupport with version info and supported features
175175 """
176- info = await client .info ("server" )
177- redis_version = info .get ("redis_version" , "0.0.0" )
176+ info = await client .info ("server" ) # type: ignore[union-attr]
177+ redis_version = info .get ("redis_version" , "0.0.0" ) # type: ignore[union-attr]
178178
179179 modules = await RedisConnectionFactory .get_modules_async (client )
180180 search_ver = modules .get ("search" , 0 )
@@ -192,66 +192,6 @@ async def check_vector_capabilities_async(client: AsyncRedisClient) -> VectorSup
192192 )
193193
194194
195- def supports_svs_vamana (client : SyncRedisClient ) -> bool :
196- """Check if Redis server supports SVS-VAMANA algorithm.
197-
198- SVS-Vamana requires:
199- - Redis version >= 8.2.0
200- - RediSearch version >= 2.8.10 (20810)
201-
202- Args:
203- client: Sync Redis client instance
204-
205- Returns:
206- bool: True if SVS-VAMANA is supported, False otherwise
207- """
208- info = client .info ()
209- redis_version = info .get ("redis_version" , "0.0.0" )
210- if not compare_versions (redis_version , SVS_MIN_REDIS_VERSION ):
211- return False
212-
213- # Check module versions
214- modules = unpack_redis_modules (convert_bytes (client .module_list ()))
215- for module in SVS_REQUIRED_MODULES :
216- module_name = module ["name" ]
217- required_version = module ["ver" ]
218- if module_name not in modules :
219- return False
220- if modules [module_name ] < required_version :
221- return False
222- return True
223-
224-
225- async def async_supports_svs_vamana (client : AsyncRedisClient ) -> bool :
226- """Check if Redis server supports SVS-VAMANA algorithm asynchronously.
227-
228- SVS-Vamana requires:
229- - Redis version >= 8.2.0
230- - RediSearch version >= 2.8.10 (20810)
231-
232- Args:
233- client: Sync Redis client instance
234-
235- Returns:
236- bool: True if SVS-VAMANA is supported, False otherwise
237- """
238- info = await client .info ()
239- redis_version = info .get ("redis_version" , "0.0.0" )
240- if not compare_versions (redis_version , SVS_MIN_REDIS_VERSION ):
241- return False
242-
243- # Check module versions
244- modules = unpack_redis_modules (convert_bytes (await client .module_list ()))
245- for module in SVS_REQUIRED_MODULES :
246- module_name = module ["name" ]
247- required_version = module ["ver" ]
248- if module_name not in modules :
249- return False
250- if modules [module_name ] < required_version :
251- return False
252- return True
253-
254-
255195def get_address_from_env () -> str :
256196 """Get Redis URL from environment variable."""
257197 redis_url = os .getenv (REDIS_URL_ENV_VAR )
@@ -558,6 +498,7 @@ async def _get_aredis_connection(
558498 """
559499 url = url or get_address_from_env ()
560500
501+ client : AsyncRedisClient
561502 if url .startswith ("redis+sentinel" ):
562503 client = RedisConnectionFactory ._redis_sentinel_client (
563504 url , AsyncRedis , ** kwargs
0 commit comments