Skip to content

Commit 407f798

Browse files
ethanlee928ethanleeTranquility2
authored
fix(qdrant): migrate Qdrant from deprecated decorator. (#963)
## Summary Hello, this PR addresses the deprecation warning coming from `QdrantContainer`. The container currently uses the deprecated `@wait_container_is_ready()` decorator, which is scheduled for removal. This change migrates to the recommended `LogMessageWaitStrategy`. Additionally, the Qdrant Docker image version has been updated to match the Qdrant client version, resolving the following warning: `UserWarning: Qdrant client version 1.16.2 is incompatible with server version 1.13.5.` ## Testing All qdrant test cases passed: ```bash poetry run pytest modules/qdrant/tests/ -v ============== 4 passed, 3 warnings in 3.07s ============== ``` The remaining warnings are related to `UserWarning: Api key is used with an insecure connection.`, which is out of scope for this PR. Thank you for reviewing! --------- Co-authored-by: ethanlee <ethanlee@sebit.world> Co-authored-by: Roy Moore <roy@moore.co.il>
1 parent d48115d commit 407f798

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

modules/qdrant/testcontainers/qdrant/__init__.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
1515
from pathlib import Path
1616
from typing import Optional
1717

18-
from testcontainers.core.config import testcontainers_config as c
19-
from testcontainers.core.generic import DbContainer
20-
from testcontainers.core.waiting_utils import wait_container_is_ready, wait_for_logs
18+
from testcontainers.core.container import DockerContainer
19+
from testcontainers.core.wait_strategies import LogMessageWaitStrategy
2120

2221

23-
class QdrantContainer(DbContainer):
22+
class QdrantContainer(DockerContainer):
2423
"""
2524
Qdrant vector database container.
2625
@@ -39,7 +38,7 @@ class QdrantContainer(DbContainer):
3938

4039
def __init__(
4140
self,
42-
image: str = "qdrant/qdrant:v1.13.5",
41+
image: str = "qdrant/qdrant:v1.16.2",
4342
rest_port: int = 6333,
4443
grpc_port: int = 6334,
4544
api_key: Optional[str] = None,
@@ -59,9 +58,8 @@ def __init__(
5958
def _configure(self) -> None:
6059
self.with_env("QDRANT__SERVICE__API_KEY", self._api_key)
6160

62-
@wait_container_is_ready()
6361
def _connect(self) -> None:
64-
wait_for_logs(self, ".*Actix runtime found; starting in Actix runtime.*", c.timeout)
62+
LogMessageWaitStrategy(".*Actix runtime found; starting in Actix runtime.*").wait_until_ready(self)
6563

6664
def get_client(self, **kwargs):
6765
"""

0 commit comments

Comments
 (0)