Skip to content

Commit

Permalink
Test connection to Qdrant (apache#39273)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anush008 authored and RodrigoGanancia committed May 10, 2024
1 parent 5153f2b commit caddf84
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 caddf84

Please sign in to comment.