Skip to content

Commit

Permalink
Test connection to Qdrant (#39273)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anush008 authored Apr 26, 2024
1 parent 8188da7 commit 0c96b06
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions airflow/providers/qdrant/hooks/qdrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion airflow/providers/qdrant/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ integrations:
tags: [software]

dependencies:
- qdrant_client>=1.7.0
- qdrant_client>=1.9.0
- apache-airflow>=2.7.0

hooks:
Expand Down
2 changes: 1 addition & 1 deletion generated/provider_dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/docker-compose/integration-qdrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)

Expand Down

0 comments on commit 0c96b06

Please sign in to comment.