From daade537c26071fc29059bade470b8932f491da9 Mon Sep 17 00:00:00 2001 From: Filip Knefel Date: Thu, 2 Jan 2025 11:28:31 +0100 Subject: [PATCH 1/2] Upload second time to test qdrant upsert behavior --- test/integration/connectors/test_qdrant.py | 29 ++++++++++++++++------ 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/test/integration/connectors/test_qdrant.py b/test/integration/connectors/test_qdrant.py index d3ab1f563..5f7f55f77 100644 --- a/test/integration/connectors/test_qdrant.py +++ b/test/integration/connectors/test_qdrant.py @@ -109,6 +109,14 @@ async def test_qdrant_destination_local(upload_file: Path, tmp_path: Path): async with qdrant_client(connection_kwargs) as client: await validate_upload(client=client, upload_file=upload_file) + # Repeat upload to test the upsert functionality + if uploader.is_async(): + await uploader.run_async(path=staged_upload_file, file_data=file_data) + else: + uploader.run(path=upload_file, file_data=file_data) + async with qdrant_client(connection_kwargs) as client: + await validate_upload(client=client, upload_file=upload_file) + @pytest.fixture def docker_context(): @@ -144,10 +152,12 @@ async def test_qdrant_destination_server(upload_file: Path, tmp_path: Path, dock output_filename=upload_file.name, ) uploader.precheck() - if uploader.is_async(): - await uploader.run_async(path=staged_upload_file, file_data=file_data) - else: - uploader.run(path=upload_file, file_data=file_data) + await uploader.run_async(path=staged_upload_file, file_data=file_data) + async with qdrant_client(connection_kwargs) as client: + await validate_upload(client=client, upload_file=upload_file) + + # NOTE: Upload the second time to validate upsert behavior + await uploader.run_async(path=staged_upload_file, file_data=file_data) async with qdrant_client(connection_kwargs) as client: await validate_upload(client=client, upload_file=upload_file) @@ -189,10 +199,13 @@ async def test_qdrant_destination_cloud(upload_file: Path, tmp_path: Path): output_filename=upload_file.name, ) uploader.precheck() - if uploader.is_async(): - await uploader.run_async(path=staged_upload_file, file_data=file_data) - else: - uploader.run(path=staged_upload_file, file_data=file_data) + + await uploader.run_async(path=staged_upload_file, file_data=file_data) + async with qdrant_client(connection_kwargs) as client: + await validate_upload(client=client, upload_file=upload_file) + + # NOTE: Upload the second time to validate upsert behavior + await uploader.run_async(path=staged_upload_file, file_data=file_data) async with qdrant_client(connection_kwargs) as client: await validate_upload(client=client, upload_file=upload_file) From 6e6172cea8c7c03322bb464a5d26b1705323a6fb Mon Sep 17 00:00:00 2001 From: Filip Knefel Date: Thu, 2 Jan 2025 11:35:49 +0100 Subject: [PATCH 2/2] Bump version --- CHANGELOG.md | 2 +- unstructured_ingest/__version__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index caa9d87f2..ce35f59e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.3.12-dev3 +## 0.3.12-dev4 ### Enhancements diff --git a/unstructured_ingest/__version__.py b/unstructured_ingest/__version__.py index 3ad6f8bfe..5d08f71ba 100644 --- a/unstructured_ingest/__version__.py +++ b/unstructured_ingest/__version__.py @@ -1 +1 @@ -__version__ = "0.3.12-dev3" # pragma: no cover +__version__ = "0.3.12-dev4" # pragma: no cover