From 0c96b062044a96bcfb83991a4f4fac8e14c0bb57 Mon Sep 17 00:00:00 2001 From: Anush Date: Fri, 26 Apr 2024 12:21:12 +0530 Subject: [PATCH] Test connection to Qdrant (#39273) --- airflow/providers/qdrant/hooks/qdrant.py | 4 ++++ airflow/providers/qdrant/provider.yaml | 2 +- generated/provider_dependencies.json | 2 +- scripts/ci/docker-compose/integration-qdrant.yml | 2 +- .../providers/qdrant/operators/test_qdrant_ingest.py | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/airflow/providers/qdrant/hooks/qdrant.py b/airflow/providers/qdrant/hooks/qdrant.py index 31aa0b5e1d428..0e501b8ac6922 100644 --- a/airflow/providers/qdrant/hooks/qdrant.py +++ b/airflow/providers/qdrant/hooks/qdrant.py @@ -126,3 +126,7 @@ def verify_connection(self) -> tuple[bool, str]: return True, "Connection established!" except (UnexpectedResponse, RpcError, ValueError) as e: return False, str(e) + + def test_connection(self) -> tuple[bool, str]: + """Test the connection to the Qdrant instance.""" + return self.verify_connection() diff --git a/airflow/providers/qdrant/provider.yaml b/airflow/providers/qdrant/provider.yaml index 7d62ed57e6075..7a95d58ae6ff8 100644 --- a/airflow/providers/qdrant/provider.yaml +++ b/airflow/providers/qdrant/provider.yaml @@ -38,7 +38,7 @@ integrations: tags: [software] dependencies: - - qdrant_client>=1.7.0 + - qdrant_client>=1.9.0 - apache-airflow>=2.7.0 hooks: diff --git a/generated/provider_dependencies.json b/generated/provider_dependencies.json index a95bcd312e04f..d91b48858029a 100644 --- a/generated/provider_dependencies.json +++ b/generated/provider_dependencies.json @@ -950,7 +950,7 @@ "qdrant": { "deps": [ "apache-airflow>=2.7.0", - "qdrant_client>=1.7.0" + "qdrant_client>=1.9.0" ], "devel-deps": [], "cross-providers-deps": [], diff --git a/scripts/ci/docker-compose/integration-qdrant.yml b/scripts/ci/docker-compose/integration-qdrant.yml index 724c1e92cfb4b..1cafac732d866 100644 --- a/scripts/ci/docker-compose/integration-qdrant.yml +++ b/scripts/ci/docker-compose/integration-qdrant.yml @@ -18,7 +18,7 @@ version: "3.8" services: qdrant: - image: qdrant/qdrant:latest + image: qdrant/qdrant:v1.9.0 labels: breeze.description: "Integration required for Qdrant tests." ports: diff --git a/tests/integration/providers/qdrant/operators/test_qdrant_ingest.py b/tests/integration/providers/qdrant/operators/test_qdrant_ingest.py index eed4bd8e78db9..534622ec907e8 100644 --- a/tests/integration/providers/qdrant/operators/test_qdrant_ingest.py +++ b/tests/integration/providers/qdrant/operators/test_qdrant_ingest.py @@ -60,7 +60,7 @@ def test_execute_hello(self): hook = operator.hook - hook.conn.recreate_collection( + hook.conn.create_collection( collection_name, vectors_config=VectorParams(size=dimensions, distance=Distance.COSINE) )