Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: qdrant upload twice to test upsert behavior #321

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.3.12-dev3
## 0.3.12-dev4

### Enhancements

Expand Down
29 changes: 21 additions & 8 deletions test/integration/connectors/test_qdrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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)
Comment on lines -147 to +160
Copy link
Contributor

@mpolomdeepsense mpolomdeepsense Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why the previous change includes both async and sync run (if not async) but here you removed that and use async only?

async with qdrant_client(connection_kwargs) as client:
await validate_upload(client=client, upload_file=upload_file)

Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion unstructured_ingest/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.3.12-dev3" # pragma: no cover
__version__ = "0.3.12-dev4" # pragma: no cover
Loading