fix(qdrant): Allow async-only initialization with hybrid search #20005
+123
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a crash in QdrantVectorStore when initializing with only an async client (aclient) and enable_hybrid=True. It also ensures the lazy correction mechanism for legacy collections correctly handles user-provided custom functions.
Key Changes:
Prevents AttributeError: Guards synchronous checks in init to prevent crashes with async-only clients.
Robust Legacy Support: Implements lazy detection and adaptation to legacy sparse vector formats in async-only mode.
Respects Customizations: Auto-correction logic now preserves user-provided encoder functions.
Adds Comprehensive Tests: New tests for async initialization, legacy format correction, and hybrid search.
No Breaking Changes: Maintains full backward compatibility.
Fixes #20002
New Package?
Did I fill in the tool.llamahub section in the pyproject.toml and provide a detailed README.md for my new integration or package?
[ ] Yes
[x] No
Version Bump?
Did I bump the version in the pyproject.toml file of the package I am updating? (Except for the llama-index-core package)
[x] Yes
[ ] No
Type of Change
Please delete options that are not relevant.
[x] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
Your pull-request will likely not be merged unless it is covered by some form of impactful unit testing.
[x] I added new unit tests to cover this change
Suggested Checklist:
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] I have added Google Colab support for the newly added notebooks.
[x] My changes generate no new warnings
[x] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
[x] I ran uv run make format; uv run make lint to appease the lint gods