Drop python3.9#1110
Conversation
* new: direct uuid support * tests: add uuid tests * fix: update inspection cache
* new: add collection metadata and tests to local mode * fix: regen async client
* new: implement parametrized rrf in local mode * refactoring: use a variable for a magic value * fix: adjust conversion according to AI
* new: add missing update_filter, implement it in local mode * fix: fix type hint, fix update operation, fix rest uploader, add tests * fix: fix update filter is None case * fix: mypy was not a good boy
* new: add match text any local mode * tests: add match text any tests
* new: update models, remove init_from and locks * deprecate: remove init from tests * deprecate: remove lock tests * new: convert ascii_folding * fix: fix type stub * new: convert acorn * new: convert shard key with fallback * new: update grpcio and grpcio tools in generator (#1106) * new: update grpcio and grpcio tools in generator * fix: bind grpcio and tools versions to 1.62.0 in generator * Remove deprecated methods (#1103) * deprecate: remove old api methods * deprecate: remove type stub for removed methods * deprecate: remove old api methods from test_qdrant_client * deprecate: replace search with query points in test_in_memory * deprecate: replace search methods in fastembed mixin with query points * deprecate: replace old api methods in test async qdrant client * deprecate: replace search with query points in test delete points * deprecate: replace discover and context with query points in test_discovery * deprecate: replace recommend_groups with query_points_groups in test_group_recommend * deprecate: replace search_groups in test_group_search * deprecate: replace recommend with query points in test_recommendation * deprecate: replace search with query points in test search * deprecate: replace context and discover with query points in test sparse discovery * deprecate: replace search with query points in test sparse idf search * deprecate: replace recommend with query points in test sparse recommend * deprecate: replace search with query points in test sparse search * deprecate: replace missing search request with query request in qdrant_fastembed * deprecate: replace search with query points in test multivector search queries * deprecate: replace upload records with upload points in test_updates * deprecate: remove redundant structs (#1104) * deprecate: remove redundant structs * fix: do not use removed conversions in local mode * fix: remove redundant conversions, simplify types.QueryRequest * deprecate: replace old style grpc vector conversion to a new one (#1105) * deprecate: replace old style grpc vector conversion to a new one * fix: ignore union attr in conversion * review fixes --------- Co-authored-by: generall <[email protected]> --------- Co-authored-by: generall <[email protected]> --------- Co-authored-by: generall <[email protected]> * new: deprecate add, query, query_batch in fastembed mixin (#1102) * new: deprecate add, query, query_batch in fastembed mixin * 1.16 -> 1.17 --------- Co-authored-by: generall <[email protected]> --------- Co-authored-by: generall <[email protected]>
edd626e to
5c16826
Compare
✅ Deploy Preview for poetic-froyo-8baba7 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughModernized type annotations across the repository to Python 3.10+ PEP 604 union syntax (e.g., Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Areas to review closely:
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧬 Code graph analysis (1)tests/congruence_tests/test_common.py (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
🔇 Additional comments (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (5)
qdrant_client/local/datetime_utils.py (1)
18-26: Update docstring to match the new type annotation.The return type annotation has been updated to
datetime | None, but the docstring at line 25 still referencesOptional[datetime].Apply this diff to update the docstring:
Returns: - Optional[datetime]: the datetime if the string is valid, otherwise None + datetime | None: the datetime if the string is valid, otherwise Noneqdrant_client/hybrid/formula.py (1)
223-223: Complete the typing modernization by using lowercasetuple.Line 223 still uses
Tuplefrom thetypingmodule, which is inconsistent with the PEP 604 modernization applied elsewhere. Python 3.10+ supports the built-intupletype for annotations.Apply this diff to complete the modernization:
-) -> Tuple[float, float, float, float]: +) -> tuple[float, float, float, float]:Then update the imports on line 6:
-from typing import Any, Tuple +from typing import Anyqdrant_client/hybrid/fusion.py (1)
1-1: Remove unused Optional import.The
Optionalimport on line 1 is no longer used since the parameter type was updated to use PEP 604 union syntax (int | None) on line 12.Apply this diff:
-from typing import Optional - from qdrant_client.http import modelsqdrant_client/conversions/conversion.py (1)
2035-2043: Removeis not Nonefrom the HasField check on line 2037.The code at line 2037 is the only occurrence in the file where
HasField()is followed byis not None. SinceHasField()returns a boolean, the conditionmodel.HasField("index") is not Noneis alwaysTrue, causing the index to always be converted regardless of whether the field is set. Every other usage in the file (lines 188–191, 201–204, 260–261, 265–266, 274–278, 290–300, etc.) correctly usesif model.HasField("field")directly. Line 2041 in the same method demonstrates the correct pattern.Fix:
index=( cls.convert_sparse_index_config(model.index) - if model.HasField("index") is not None + if model.HasField("index") else None ),qdrant_client/local/qdrant_local.py (1)
9-17: Fix mypy error: remove strayOptionalusage inrecreate_collection
Optionalis no longer imported fromtyping, butmetadatainrecreate_collectionstill usesOptional[...], which is exactly what the mypy pipeline error reports. Update the annotation to use the new| Nonestyle instead of re‑introducingOptional.Suggested diff:
-from typing import ( - Any, - Generator, - Iterable, - Mapping, - Sequence, - get_args, - Union, -) +from typing import ( + Any, + Generator, + Iterable, + Mapping, + Sequence, + get_args, + Union, +) @@ def recreate_collection( self, collection_name: str, - vectors_config: types.VectorParams | Mapping[str, types.VectorParams] | None = None, - sparse_vectors_config: Mapping[str, types.SparseVectorParams] | None = None, - metadata: Optional[types.Payload] = None, + vectors_config: types.VectorParams | Mapping[str, types.VectorParams] | None = None, + sparse_vectors_config: Mapping[str, types.SparseVectorParams] | None = None, + metadata: types.Payload | None = None, **kwargs: Any, ) -> bool:This aligns
recreate_collectionwith the rest of the file’s updated typing and resolves the mypy failure. -->Also applies to: 803-813
🧹 Nitpick comments (15)
tools/async_client_generator/transformers/function_def_transformer.py (1)
25-27: Optional: Consider addressing unusedtype_paramsvariable.The
type_paramsvariable is assigned on line 26 but never used. If it should be passed toast.AsyncFunctionDef, consider adding it; otherwise, this code block could be removed.Note: This is pre-existing code, not introduced by this PR.
qdrant_client/conversions/conversion.py (1)
991-1003: Vector conversion union types look correct; consider tightening typings forVectorOutput.The updated unions:
_convert_vector(cls, model: grpc.Vector | grpc.VectorOutput) -> tuple[str | None, list[float] | list[list[float]] | rest.SparseVector | grpc.Document | grpc.Image | grpc.InferenceObject]convert_vector(...) -> list[float] | list[list[float]] | rest.SparseVector | rest.Document | rest.Image | rest.InferenceObjectconvert_vector_output(...) -> list[float] | list[list[float]] | rest.SparseVectorare consistent with the protobuf stubs:
Vectorsupports document/image/object, whileVectorOutputonly supports dense/sparse/multi-dense. The runtime behavior stays the same.If you care about static type-checker precision, you might eventually want overloads or a generic
_convert_vectorso that the type ofvalis narrower when called withgrpc.VectorOutput(today,_convert_vector’s return annotation still includesgrpc.Document/grpc.Image/grpc.InferenceObject, which strict checkers may see as incompatible with the narrowerconvert_vector_outputreturn type).Also applies to: 1040-1049, 1067-1073
qdrant_client/connection.py (1)
240-255: Alignparse_ssl_credentialsdocstring with updated return typeThe function is now annotated as returning
dict[str, bytes | None], while the docstring still mentionsdict[str, Optional[bytes]]. They describe the same shape, but the docstring is slightly stale relative to the annotations. Consider updating the docstring to match the PEP 604 style for consistency.Also applies to: 257-289
qdrant_client/local/payload_filters.py (1)
266-276: Tightencheck_min_shouldvector typing to reflect actual usage
check_min_shouldcurrently annotatesvectors: dict[str, Any], but it’s always called with the samehas_vectormap used elsewhere (dict[str, bool]) and is passed straight intocheck_condition’shas_vector: dict[str, bool]parameter.If there’s no intent to support other shapes here, consider updating the annotation to
dict[str, bool]for consistency with the rest of the file:-def check_min_should( +def check_min_should( @@ - vectors: dict[str, Any], + vectors: dict[str, bool],qdrant_client/embed/model_embedder.py (1)
87-120: Expanded model input unions match usage; consider updating docstringsAllowing:
embed_models(raw_models: BaseModel | Iterable[BaseModel])embed_models_strict(raw_models: Iterable[dict[str, BaseModel] | BaseModel], ...)embed_models_batch(raw_models: list[dict[str, BaseModel] | BaseModel], ...)_process_model(model: dict[str, BaseModel] | BaseModel, ..., inference_batch_size: int | None = None, ...)matches the existing control flow: single models are wrapped into lists, mappings are handled via the
dictbranch, andinference_batch_sizeremains optional when accumulating and required when draining.Runtime behavior is unchanged and the API is strictly more ergonomic. The docstrings, however, still describe only
Iterable[BaseModel]inputs; you may want to expand them to mention the new accepted shapes to avoid confusion for users reading the docs.Also applies to: 171-176, 208-295
qdrant_client/embed/embedder.py (1)
29-45: Clarify or remove unusedkwargsinEmbedder.__init__Static analysis correctly flags
kwargsas unused here:__init__only storesthreads. If**kwargsis kept solely for API compatibility, consider either:
- Renaming to
_kwargsor adding a short comment to silence linters, or- Actually wiring any supported options through, or
- Dropping it from the signature if you’re confident nothing depends on it.
This will make intent clearer and avoid future confusion about configuration knobs that are silently ignored.
qdrant_client/client_base.py (2)
43-55: Unify to PEP 604 union syntax for consistencySince we’ve dropped 3.9, consider switching this Union[...] to native unions for consistency with the rest of the file.
- query: Union[ - types.PointId, - list[float], - list[list[float]], - types.SparseVector, - types.Query, - types.NumpyArray, - types.Document, - types.Image, - types.InferenceObject, - None, - ] = None, + query: ( + types.PointId + | list[float] + | list[list[float]] + | types.SparseVector + | types.Query + | types.NumpyArray + | types.Document + | types.Image + | types.InferenceObject + | None + ) = None,If applied in both query_points and query_points_groups, you can drop the
Unionimport here.
73-85: Apply the same PEP 604 refactor hereMirror the PEP 604 change for the group query signature to keep API style uniform.
- query: Union[ + query: ( types.PointId, list[float], list[list[float]], types.SparseVector, types.Query, types.NumpyArray, types.Document, types.Image, types.InferenceObject, None, - ] = None, + ) = None,qdrant_client/async_qdrant_remote.py (1)
201-201: Silence unusedkwargsin autogenerated methodsRuff flags ARG002 on these methods. Since this file is autogenerated, prefer fixing the generator to either:
- prefix param as
_kwargs, or- insert
del kwargs # noqa: ARG002at function start.Example patch pattern the generator could emit:
async def close(self, grpc_grace: float | None = None, **kwargs: Any) -> None: + del kwargs # noqa: ARG002 -- autogenerated: unused passthroughAlternatively, add a per-file Ruff ignore for ARG002 in generated headers.
Also applies to: 752-752, 1754-1754, 2220-2220, 2278-2278
qdrant_client/qdrant_fastembed.py (2)
803-819: Adopt PEP 604 unions in _resolve_query signatureAlign this with the rest of the file and PR theme.
- def _resolve_query( - cls, - query: Union[ - types.PointId, - list[float], - list[list[float]], - types.SparseVector, - types.Query, - types.NumpyArray, - models.Document, - models.Image, - models.InferenceObject, - None, - ], - ) -> models.Query | None: + def _resolve_query( + cls, + query: ( + types.PointId + | list[float] + | list[list[float]] + | types.SparseVector + | types.Query + | types.NumpyArray + | models.Document + | models.Image + | models.InferenceObject + | None + ), + ) -> models.Query | None:After this change, you can drop
Unionfrom the imports if unused elsewhere in this module.
522-532: Docs still use Optional[...] phrasingNon-blocking, but consider updating docstrings to reflect
T | Noneterminology for consistency with the new typing.Also applies to: 621-707, 708-716
qdrant_client/async_qdrant_client.py (1)
1-11: Autogenerated file: avoid manual edits; consider generator lint hintsIf Ruff flags ARG002 on unused kwargs here in the future, prefer adding a header-based ignore or auto‑inserting a no‑op
del kwargs.qdrant_client/local/qdrant_local.py (2)
442-497:query_points_groupstypings andwith_lookupresolution are coherentNew union annotations for
using,prefetch,query_filter,search_params,with_payload,with_vectors,score_threshold,with_lookup, andlookup_fromcorrectly reflect the different accepted shapes, and thewith_lookup_collectionresolution logic remains unchanged. One minor gap:search_paramsis accepted but not forwarded tocollection.query_groups, so the parameter is effectively ignored.If you decide to address this later, consider passing
search_paramsthrough:- return collection.query_groups( - query=query, - query_filter=query_filter, - using=using, - prefetch=prefetch, - limit=limit, - group_by=group_by, - group_size=group_size, - with_payload=with_payload, - with_vectors=with_vectors, - score_threshold=score_threshold, - with_lookup=with_lookup, - with_lookup_collection=with_lookup_collection, - ) + return collection.query_groups( + query=query, + query_filter=query_filter, + using=using, + prefetch=prefetch, + limit=limit, + group_by=group_by, + group_size=group_size, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + with_lookup=with_lookup, + with_lookup_collection=with_lookup_collection, + search_params=search_params, + )
748-769:_collection_pathreturningstr | None—behavior change looks intentional
_collection_pathnow returnsNonewhenself.persistentisFalse, and callers (e.g.,delete_collection,create_collection) are already checking foris not Nonebefore performing filesystem operations. This aligns with the async local implementation and avoids touching the filesystem for in‑memory instances.If you haven’t already, it’s worth double‑checking that
LocalCollectioncan handlelocation=Nonefor in‑memory usage (both here and inasync_qdrant_local) to ensure no regressions in":memory:"mode. -->qdrant_client/qdrant_client.py (1)
445-611:query_points_groupsdoesn’t forwardlookup_fromto the underlying clientTyping updates are fine, but in the final call to
_client.query_points_groupsthelookup_fromargument is not passed, so the new parameter (and any caller‑supplied value) is effectively ignored. This also explains the Ruff “unused argument” warning forlookup_from.Suggested fix:
- return self._client.query_points_groups( - collection_name=collection_name, - query=query, - prefetch=prefetch, - query_filter=query_filter, - search_params=search_params, - group_by=group_by, - limit=limit, - group_size=group_size, - with_payload=with_payload, - with_vectors=with_vectors, - score_threshold=score_threshold, - using=using, - with_lookup=with_lookup, - consistency=consistency, - shard_key_selector=shard_key_selector, - timeout=timeout, - **kwargs, - ) + return self._client.query_points_groups( + collection_name=collection_name, + query=query, + prefetch=prefetch, + query_filter=query_filter, + search_params=search_params, + group_by=group_by, + limit=limit, + group_size=group_size, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + using=using, + with_lookup=with_lookup, + lookup_from=lookup_from, + consistency=consistency, + shard_key_selector=shard_key_selector, + timeout=timeout, + **kwargs, + )This makes
lookup_fromusable and removes the unused‑parameter warning without altering other behavior. -->
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (77)
.github/workflows/integration-tests-macos.yml(0 hunks).github/workflows/integration-tests.yml(1 hunks).github/workflows/python-publish.yml(1 hunks).github/workflows/type-checkers.yml(1 hunks)qdrant_client/async_client_base.py(14 hunks)qdrant_client/async_qdrant_client.py(39 hunks)qdrant_client/async_qdrant_fastembed.py(19 hunks)qdrant_client/async_qdrant_remote.py(66 hunks)qdrant_client/auth/bearer_auth.py(1 hunks)qdrant_client/client_base.py(15 hunks)qdrant_client/common/client_warnings.py(1 hunks)qdrant_client/common/version_check.py(3 hunks)qdrant_client/connection.py(7 hunks)qdrant_client/conversions/common_types.py(3 hunks)qdrant_client/conversions/conversion.py(11 hunks)qdrant_client/embed/builtin_embedder.py(2 hunks)qdrant_client/embed/common.py(1 hunks)qdrant_client/embed/embed_inspector.py(4 hunks)qdrant_client/embed/embedder.py(14 hunks)qdrant_client/embed/model_embedder.py(7 hunks)qdrant_client/embed/models.py(1 hunks)qdrant_client/embed/schema_parser.py(5 hunks)qdrant_client/embed/type_inspector.py(3 hunks)qdrant_client/embed/utils.py(2 hunks)qdrant_client/fastembed_common.py(2 hunks)qdrant_client/hybrid/formula.py(2 hunks)qdrant_client/hybrid/fusion.py(1 hunks)qdrant_client/local/async_qdrant_local.py(26 hunks)qdrant_client/local/datetime_utils.py(2 hunks)qdrant_client/local/distances.py(3 hunks)qdrant_client/local/json_path_parser.py(4 hunks)qdrant_client/local/local_collection.py(47 hunks)qdrant_client/local/multi_distances.py(3 hunks)qdrant_client/local/order_by.py(1 hunks)qdrant_client/local/payload_filters.py(10 hunks)qdrant_client/local/payload_value_extractor.py(3 hunks)qdrant_client/local/payload_value_setter.py(6 hunks)qdrant_client/local/persistence.py(3 hunks)qdrant_client/local/qdrant_local.py(27 hunks)qdrant_client/local/sparse_distances.py(4 hunks)qdrant_client/migrate/migrate.py(4 hunks)qdrant_client/parallel_processor.py(4 hunks)qdrant_client/qdrant_client.py(39 hunks)qdrant_client/qdrant_fastembed.py(19 hunks)qdrant_client/qdrant_remote.py(64 hunks)qdrant_client/uploader/grpc_uploader.py(4 hunks)qdrant_client/uploader/rest_uploader.py(4 hunks)qdrant_client/uploader/uploader.py(4 hunks)tests/congruence_tests/test_common.py(8 hunks)tests/congruence_tests/test_discovery.py(2 hunks)tests/congruence_tests/test_multivector_discovery_queries.py(2 hunks)tests/congruence_tests/test_query.py(2 hunks)tests/conversions/test_validate_conversions.py(1 hunks)tests/embed_tests/test_builtin_inference.py(2 hunks)tests/fixtures/filters.py(1 hunks)tests/fixtures/payload.py(2 hunks)tests/fixtures/points.py(3 hunks)tests/test_qdrant_client.py(0 hunks)tests/utils.py(1 hunks)tools/async_client_generator/base_client_generator.py(1 hunks)tools/async_client_generator/client_generator.py(1 hunks)tools/async_client_generator/fastembed_generator.py(1 hunks)tools/async_client_generator/local_generator.py(1 hunks)tools/async_client_generator/remote_generator.py(1 hunks)tools/async_client_generator/transformers/call_transformer.py(1 hunks)tools/async_client_generator/transformers/class_def_transformer.py(1 hunks)tools/async_client_generator/transformers/client/function_def_transformer.py(2 hunks)tools/async_client_generator/transformers/constant_transformer.py(1 hunks)tools/async_client_generator/transformers/fastembed/call_transformer.py(1 hunks)tools/async_client_generator/transformers/function_def_transformer.py(1 hunks)tools/async_client_generator/transformers/import_from_transformer.py(1 hunks)tools/async_client_generator/transformers/import_transformer.py(1 hunks)tools/async_client_generator/transformers/local/call_transformer.py(1 hunks)tools/async_client_generator/transformers/name_transformer.py(1 hunks)tools/async_client_generator/transformers/remote/function_def_transformer.py(4 hunks)tools/async_client_generator/transformers/remote/import_from_transformer.py(1 hunks)tools/populate_inspection_cache.py(1 hunks)
💤 Files with no reviewable changes (2)
- .github/workflows/integration-tests-macos.yml
- tests/test_qdrant_client.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-05-14T20:18:46.258Z
Learnt from: joein
Repo: qdrant/qdrant-client PR: 977
File: tests/congruence_tests/test_payload.py:645-651
Timestamp: 2025-05-14T20:18:46.258Z
Learning: In the Qdrant client, there is no separate `models.OverwritePayload` class. The `models.OverwritePayloadOperation` class is designed to accept a `models.SetPayload` object as its `overwrite_payload` parameter.
Applied to files:
qdrant_client/local/local_collection.py
🧬 Code graph analysis (37)
qdrant_client/conversions/common_types.py (3)
qdrant_client/grpc/points_pb2.pyi (11)
Filter(4532-4566)SearchParams(1424-1477)WithPayloadSelector(1175-1196)PointId(249-271)PointStruct(5082-5125)PointsSelector(5041-5063)LookupLocation(1862-1886)RecommendStrategy(132-133)OrderBy(1761-1786)ShardKeySelector(615-638)SearchMatrixPoints(3307-3364)qdrant_client/http/models/models.py (18)
Filter(914-924)SearchParams(2634-2652)Distance(756-767)HnswConfigDiff(1130-1158)OptimizersConfigDiff(1789-1817)CollectionParamsDiff(339-351)WalConfigDiff(3558-3563)PayloadSchemaType(1896-1911)PointStruct(1985-1988)Batch(76-79)LookupLocation(1540-1553)RecommendStrategy(2310-2320)OrderBy(1839-1847)ShardingMethod(2881-2883)CreateAliasOperation(499-500)RenameAliasOperation(2358-2363)DeleteAliasOperation(644-649)SearchMatrixRequest(2618-2631)qdrant_client/grpc/collections_pb2.pyi (13)
Distance(81-81)HnswConfigDiff(791-866)VectorsConfigDiff(511-528)QuantizationConfigDiff(1202-1227)OptimizersConfigDiff(937-1048)CollectionParamsDiff(1771-1803)WalConfigDiff(907-933)QuantizationConfig(1168-1189)PayloadSchemaType(135-135)PayloadIndexParams(2161-2210)ShardingMethod(212-212)ShardKey(2489-2506)AliasOperations(2334-2355)
tests/fixtures/filters.py (1)
tests/fixtures/payload.py (1)
random_datetime(157-173)
qdrant_client/embed/embed_inspector.py (3)
qdrant_client/embed/schema_parser.py (1)
ModelSchemaParser(29-305)qdrant_client/embed/type_inspector.py (1)
inspect(24-50)qdrant_client/embed/utils.py (1)
FieldPath(7-29)
tools/async_client_generator/transformers/fastembed/call_transformer.py (6)
tools/async_client_generator/client_generator.py (1)
async_methods(53-56)tools/async_client_generator/fastembed_generator.py (1)
async_methods(32-35)tools/async_client_generator/local_generator.py (1)
async_methods(51-54)tools/async_client_generator/remote_generator.py (1)
async_methods(85-105)tools/async_client_generator/transformers/call_transformer.py (1)
visit_Call(13-22)tools/async_client_generator/transformers/local/call_transformer.py (1)
visit_Call(7-17)
tests/congruence_tests/test_query.py (3)
qdrant_client/grpc/points_pb2.pyi (2)
models(5202-5202)QueryResponse(4013-4034)qdrant_client/fastembed_common.py (1)
QueryResponse(27-33)qdrant_client/http/models/models.py (1)
QueryResponse(2160-2161)
qdrant_client/embed/models.py (1)
qdrant_client/http/models/models.py (1)
SparseVector(3028-3034)
qdrant_client/local/payload_value_setter.py (1)
qdrant_client/local/json_path_parser.py (1)
JsonPathItem(12-18)
tests/fixtures/payload.py (1)
tests/fixtures/filters.py (1)
random_datetime(213-221)
qdrant_client/embed/type_inspector.py (3)
qdrant_client/embed/schema_parser.py (1)
ModelSchemaParser(29-305)qdrant_client/embed/embed_inspector.py (2)
inspect(23-47)_inspect_model(49-71)qdrant_client/embed/utils.py (1)
FieldPath(7-29)
qdrant_client/local/multi_distances.py (1)
qdrant_client/http/models/models.py (1)
RecommendStrategy(2310-2320)
qdrant_client/migrate/migrate.py (2)
qdrant_client/client_base.py (1)
QdrantBase(6-394)qdrant_client/http/models/models.py (1)
StrictModeConfig(3124-3169)
qdrant_client/local/distances.py (1)
qdrant_client/http/models/models.py (2)
RecommendStrategy(2310-2320)ContextQuery(454-455)
qdrant_client/uploader/grpc_uploader.py (2)
qdrant_client/http/models/models.py (2)
Batch(76-79)Filter(914-924)qdrant_client/grpc/points_pb2.pyi (2)
ShardKeySelector(615-638)Filter(4532-4566)
qdrant_client/local/sparse_distances.py (1)
qdrant_client/http/models/models.py (2)
SparseVector(3028-3034)RecommendStrategy(2310-2320)
tools/async_client_generator/transformers/local/call_transformer.py (2)
tools/async_client_generator/transformers/call_transformer.py (1)
visit_Call(13-22)tools/async_client_generator/transformers/fastembed/call_transformer.py (1)
visit_Call(8-13)
qdrant_client/auth/bearer_auth.py (2)
tests/test_async_qdrant_client.py (2)
auth_token_provider(519-524)auth_token_provider(539-544)tests/test_qdrant_client.py (2)
auth_token_provider(1792-1798)auth_token_provider(1848-1852)
qdrant_client/common/version_check.py (1)
qdrant_client/auth/bearer_auth.py (1)
BearerAuth(7-42)
qdrant_client/local/async_qdrant_local.py (3)
qdrant_client/grpc/points_pb2.pyi (49)
Filter(4532-4566)SearchParams(1424-1477)query(2899-2900)query(2971-2972)query(3112-3113)Query(2823-2880)lookup_from(1940-1941)lookup_from(2086-2087)lookup_from(2260-2261)lookup_from(2914-2915)lookup_from(3000-3001)lookup_from(3131-3132)LookupLocation(1862-1886)prefetch(2896-2897)prefetch(2968-2969)prefetch(3109-3110)PointId(249-271)update_filter(669-670)update_filter(811-812)update_filter(3456-3457)update_filter(3615-3616)points(661-661)points(707-708)points(802-803)points(1036-1037)points(3451-3451)points(3609-3610)points(3663-3664)points(3684-3685)points(4972-4973)points(5052-5052)PointStruct(5082-5125)vectors(562-562)vectors(845-846)vectors(875-876)vectors(1222-1222)vectors(1254-1254)vectors(1272-1272)vectors(1293-1293)vectors(3641-3642)vectors(3890-3891)vectors(4255-4255)vectors(5115-5115)payload(936-937)payload(3497-3497)payload(3548-3548)payload(3883-3884)payload(4253-4253)payload(5113-5113)qdrant_client/http/models/models.py (10)
Filter(914-924)SearchParams(2634-2652)LookupLocation(1540-1553)Prefetch(2023-2047)Record(2323-2332)SparseVectorParams(3051-3061)VectorParams(3449-3474)PointStruct(1985-1988)PayloadSchemaType(1896-1911)SnapshotDescription(2886-2890)qdrant_client/local/qdrant_local.py (2)
_collection_path(748-752)_upload_points(825-842)
qdrant_client/uploader/rest_uploader.py (4)
qdrant_client/async_qdrant_remote.py (1)
rest(347-353)qdrant_client/qdrant_remote.py (1)
rest(408-414)qdrant_client/http/models/models.py (2)
Batch(76-79)Filter(914-924)qdrant_client/grpc/points_pb2.pyi (2)
ShardKeySelector(615-638)Filter(4532-4566)
qdrant_client/connection.py (2)
tests/test_async_qdrant_client.py (2)
auth_token_provider(519-524)auth_token_provider(539-544)tests/test_qdrant_client.py (2)
auth_token_provider(1792-1798)auth_token_provider(1848-1852)
tools/async_client_generator/transformers/client/function_def_transformer.py (2)
tools/async_client_generator/transformers/remote/function_def_transformer.py (1)
visit_FunctionDef(68-79)tools/async_client_generator/transformers/function_def_transformer.py (1)
visit_FunctionDef(12-34)
qdrant_client/uploader/uploader.py (1)
qdrant_client/http/models/models.py (1)
Record(2323-2332)
qdrant_client/conversions/conversion.py (2)
qdrant_client/grpc/points_pb2.pyi (13)
ShardKeySelector(615-638)Vector(417-472)VectorOutput(476-519)SparseVector(538-553)Document(290-327)Image(331-370)InferenceObject(374-413)vector(1270-1270)vector(1291-1291)vector(1501-1502)vector(1657-1658)vector(2183-2183)SparseIndices(275-286)qdrant_client/http/models/models.py (4)
SparseVector(3028-3034)Document(780-795)Image(1168-1180)InferenceObject(1213-1228)
qdrant_client/async_qdrant_remote.py (5)
tests/test_async_qdrant_client.py (2)
auth_token_provider(519-524)auth_token_provider(539-544)tests/test_qdrant_client.py (2)
auth_token_provider(1792-1798)auth_token_provider(1848-1852)qdrant_client/async_client_base.py (1)
close(338-339)qdrant_client/async_qdrant_client.py (1)
close(158-165)qdrant_client/qdrant_remote.py (2)
close(255-276)_parse_url(279-287)
tools/async_client_generator/transformers/remote/function_def_transformer.py (3)
tools/async_client_generator/remote_generator.py (1)
async_methods(85-105)tools/async_client_generator/transformers/client/function_def_transformer.py (1)
visit_FunctionDef(22-26)tools/async_client_generator/transformers/function_def_transformer.py (1)
visit_FunctionDef(12-34)
qdrant_client/local/payload_filters.py (1)
qdrant_client/http/models/models.py (2)
ValuesCount(3399-3407)Filter(914-924)
tools/async_client_generator/transformers/call_transformer.py (4)
tools/async_client_generator/client_generator.py (1)
async_methods(53-56)tools/async_client_generator/remote_generator.py (1)
async_methods(85-105)tools/async_client_generator/transformers/fastembed/call_transformer.py (1)
visit_Call(8-13)tools/async_client_generator/transformers/local/call_transformer.py (1)
visit_Call(7-17)
qdrant_client/embed/model_embedder.py (2)
qdrant_client/embed/schema_parser.py (1)
ModelSchemaParser(29-305)qdrant_client/embed/utils.py (1)
FieldPath(7-29)
qdrant_client/local/qdrant_local.py (3)
qdrant_client/grpc/points_pb2.pyi (46)
Filter(4532-4566)SearchParams(1424-1477)query(2899-2900)query(2971-2972)query(3112-3113)Query(2823-2880)lookup_from(1940-1941)lookup_from(2086-2087)lookup_from(2260-2261)lookup_from(2914-2915)lookup_from(3000-3001)lookup_from(3131-3132)LookupLocation(1862-1886)prefetch(2896-2897)prefetch(2968-2969)prefetch(3109-3110)order_by(1825-1826)order_by(2849-2850)OrderBy(1761-1786)points(661-661)points(707-708)points(802-803)points(1036-1037)points(3451-3451)points(3609-3610)points(3663-3664)points(3684-3685)points(4972-4973)points(5052-5052)vectors(562-562)vectors(845-846)vectors(875-876)vectors(1222-1222)vectors(1254-1254)vectors(1272-1272)vectors(1293-1293)vectors(3641-3642)vectors(3890-3891)vectors(4255-4255)vectors(5115-5115)payload(936-937)payload(3497-3497)payload(3548-3548)payload(3883-3884)payload(4253-4253)payload(5113-5113)qdrant_client/http/models/models.py (8)
Filter(914-924)SearchParams(2634-2652)LookupLocation(1540-1553)Prefetch(2023-2047)OrderBy(1839-1847)SparseVectorParams(3051-3061)VectorParams(3449-3474)SnapshotDescription(2886-2890)qdrant_client/local/async_qdrant_local.py (1)
_collection_path(695-699)
qdrant_client/async_qdrant_fastembed.py (2)
qdrant_client/qdrant_fastembed.py (5)
sparse_embedding_model_name(99-100)set_model(102-160)embedding_model_name(93-96)get_sparse_vector_field_name(332-341)get_embedding_size(443-461)qdrant_client/http/models/models.py (4)
SparseVector(3028-3034)HnswConfigDiff(1130-1158)Modifier(1654-1663)SparseVectorParams(3051-3061)
tests/congruence_tests/test_common.py (2)
qdrant_client/http/models/models.py (2)
VectorParams(3449-3474)SparseVectorParams(3051-3061)qdrant_client/qdrant_client.py (1)
QdrantClient(26-2408)
qdrant_client/async_client_base.py (2)
qdrant_client/async_qdrant_client.py (9)
search_matrix_pairs(584-628)scroll(676-743)count(745-783)recreate_collection(1650-1740)delete_snapshot(1994-2013)list_full_snapshots(2015-2022)create_full_snapshot(2024-2039)delete_full_snapshot(2041-2059)recover_snapshot(2061-2107)qdrant_client/client_base.py (9)
search_matrix_pairs(21-30)scroll(100-111)count(113-120)recreate_collection(262-268)delete_snapshot(316-319)list_full_snapshots(321-322)create_full_snapshot(324-325)delete_full_snapshot(327-328)recover_snapshot(330-336)
qdrant_client/qdrant_client.py (7)
tests/test_async_qdrant_client.py (2)
auth_token_provider(519-524)auth_token_provider(539-544)tests/test_qdrant_client.py (2)
auth_token_provider(1792-1798)auth_token_provider(1848-1852)qdrant_client/async_client_base.py (1)
close(338-339)qdrant_client/async_qdrant_client.py (1)
close(158-165)qdrant_client/async_qdrant_remote.py (1)
close(201-222)qdrant_client/client_base.py (1)
close(362-363)qdrant_client/qdrant_remote.py (1)
close(255-276)
qdrant_client/client_base.py (3)
qdrant_client/grpc/points_pb2.pyi (58)
Filter(4532-4566)SearchMatrixOffsetsResponse(4507-4528)prefetch(2896-2897)prefetch(2968-2969)prefetch(3109-3110)SearchParams(1424-1477)offset(1808-1809)with_payload(751-752)with_payload(1509-1510)with_payload(1614-1615)with_payload(1665-1666)with_payload(1813-1814)with_payload(1925-1926)with_payload(2073-2074)with_payload(2247-2248)with_payload(2991-2992)with_payload(3125-3126)with_vectors(754-755)with_vectors(1521-1522)with_vectors(1617-1618)with_vectors(1675-1676)with_vectors(1816-1817)with_vectors(1937-1938)with_vectors(2083-2084)with_vectors(2257-2258)with_vectors(2988-2989)with_vectors(3128-3129)lookup_from(1940-1941)lookup_from(2086-2087)lookup_from(2260-2261)lookup_from(2914-2915)lookup_from(3000-3001)lookup_from(3131-3132)LookupLocation(1862-1886)order_by(1825-1826)order_by(2849-2850)OrderBy(1761-1786)PointId(249-271)vectors(562-562)vectors(845-846)vectors(875-876)vectors(1222-1222)vectors(1254-1254)vectors(1272-1272)vectors(1293-1293)vectors(3641-3642)vectors(3890-3891)vectors(4255-4255)vectors(5115-5115)payload(936-937)payload(3497-3497)payload(3548-3548)payload(3883-3884)payload(4253-4253)payload(5113-5113)ids(748-749)ids(3427-3428)ids(5072-5072)qdrant_client/http/models/models.py (9)
Filter(914-924)SearchMatrixOffsetsResponse(2597-2601)Prefetch(2023-2047)SearchParams(2634-2652)LookupLocation(1540-1553)OrderBy(1839-1847)Record(2323-2332)VectorParams(3449-3474)SnapshotDescription(2886-2890)qdrant_client/async_client_base.py (5)
search_matrix_pairs(31-40)scroll(107-118)count(120-127)recreate_collection(251-257)delete_snapshot(299-302)
qdrant_client/async_qdrant_client.py (5)
qdrant_client/async_client_base.py (1)
close(338-339)qdrant_client/async_qdrant_remote.py (1)
close(201-222)qdrant_client/qdrant_client.py (1)
close(172-179)qdrant_client/grpc/points_pb2.pyi (26)
ReadConsistency(228-245)prefetch(2896-2897)prefetch(2968-2969)prefetch(3109-3110)Filter(4532-4566)SearchParams(1424-1477)lookup_from(1940-1941)lookup_from(2086-2087)lookup_from(2260-2261)lookup_from(2914-2915)lookup_from(3000-3001)lookup_from(3131-3132)LookupLocation(1862-1886)ShardKeySelector(615-638)PointId(249-271)ordering(663-664)ordering(710-711)ordering(805-806)ordering(878-879)ordering(942-943)ordering(995-996)ordering(1039-1040)ordering(1085-1086)ordering(1124-1125)ordering(3763-3764)WriteOrdering(213-224)qdrant_client/http/models/models.py (5)
Prefetch(2023-2047)Filter(914-924)SearchParams(2634-2652)LookupLocation(1540-1553)WriteOrdering(3580-3590)
qdrant_client/qdrant_remote.py (1)
qdrant_client/async_qdrant_remote.py (15)
close(201-222)_parse_url(225-233)query_batch_points(473-515)http(356-362)set_payload(1311-1362)overwrite_payload(1364-1412)delete_payload(1414-1459)clear_payload(1461-1506)update_collection_aliases(1548-1582)get_collection(1642-1656)collection_exists(1658-1670)update_collection(1672-1751)grpc_collections(299-308)delete_collection(1753-1767)create_collection(1769-1860)
qdrant_client/local/local_collection.py (3)
qdrant_client/http/models/models.py (17)
NamedVector(1700-1706)NamedSparseVector(1691-1697)Filter(914-924)Prefetch(2023-2047)SparseVector(3028-3034)Document(780-795)Image(1168-1180)InferenceObject(1213-1228)RecommendStrategy(2310-2320)ContextPair(449-451)Record(2323-2332)CountResult(474-475)PointStruct(1985-1988)Batch(76-79)PointVectors(1991-1993)FilterSelector(927-929)PointIdsList(1968-1970)qdrant_client/grpc/points_pb2.pyi (67)
vector(1270-1270)vector(1291-1291)vector(1501-1502)vector(1657-1658)vector(2183-2183)models(5202-5202)payload(936-937)payload(3497-3497)payload(3548-3548)payload(3883-3884)payload(4253-4253)payload(5113-5113)Filter(4532-4566)query(2899-2900)query(2971-2972)query(3112-3113)Query(2823-2880)prefetch(2896-2897)prefetch(2968-2969)prefetch(3109-3110)PointId(249-271)SparseVector(538-553)Document(290-327)Image(331-370)InferenceObject(374-413)Vector(417-472)positive(1914-1915)positive(2062-2063)positive(2202-2202)positive(2394-2395)positive(2420-2421)VectorInput(572-611)negative(1917-1918)negative(2065-2066)negative(2204-2204)negative(2397-2398)negative(2423-2424)RecommendStrategy(132-133)CountResult(4211-4221)points(661-661)points(707-708)points(802-803)points(1036-1037)points(3451-3451)points(3609-3610)points(3663-3664)points(3684-3685)points(4972-4973)points(5052-5052)PointStruct(5082-5125)vectors(562-562)vectors(845-846)vectors(875-876)vectors(1222-1222)vectors(1254-1254)vectors(1272-1272)vectors(1293-1293)vectors(3641-3642)vectors(3890-3891)vectors(4255-4255)vectors(5115-5115)PointVectors(836-854)ids(748-749)ids(3427-3428)ids(5072-5072)keys(989-990)keys(3581-3581)qdrant_client/local/json_path_parser.py (2)
JsonPathItem(12-18)parse_json_path(21-61)
🪛 GitHub Actions: Integration tests
qdrant_client/local/async_qdrant_local.py
[error] 750-750: NameError: name 'Optional' is not defined. Missing import from typing; add 'from typing import Optional'.
🪛 GitHub Actions: type-checkers
qdrant_client/local/async_qdrant_local.py
[error] 750-750: Command failed: poetry run mypy . --exclude "tools/async_client_generator" --disallow-incomplete-defs --disallow-untyped-defs. mypy error: Name 'Optional' is not defined in this file. Did you forget to import it from typing? (Suggestion: 'from typing import Optional')
qdrant_client/local/qdrant_local.py
[error] 807-807: Command failed: poetry run mypy . --exclude "tools/async_client_generator" --disallow-incomplete-defs --disallow-untyped-defs. mypy error: Name 'Optional' is not defined in this file. Did you forget to import it from typing? (Suggestion: 'from typing import Optional')
🪛 Ruff (0.14.4)
qdrant_client/local/async_qdrant_local.py
173-173: Unused method argument: search_params
(ARG002)
354-354: Unused method argument: search_params
(ARG002)
421-421: Unused method argument: search_params
(ARG002)
467-467: Unused method argument: kwargs
(ARG002)
763-763: Unused method argument: kwargs
(ARG002)
827-827: Unused method argument: field_schema
(ARG002)
828-828: Unused method argument: field_type
(ARG002)
qdrant_client/async_qdrant_remote.py
201-201: Unused method argument: kwargs
(ARG002)
752-752: Unused method argument: kwargs
(ARG002)
1754-1754: Unused method argument: kwargs
(ARG002)
2220-2220: Unused method argument: kwargs
(ARG002)
2278-2278: Unused method argument: kwargs
(ARG002)
qdrant_client/embed/embedder.py
30-30: Unused method argument: kwargs
(ARG002)
qdrant_client/local/qdrant_local.py
184-184: Unused method argument: search_params
(ARG002)
388-388: Unused method argument: search_params
(ARG002)
461-461: Unused method argument: search_params
(ARG002)
508-508: Unused method argument: kwargs
(ARG002)
891-891: Unused method argument: field_schema
(ARG002)
892-892: Unused method argument: field_type
(ARG002)
qdrant_client/qdrant_client.py
471-471: Unused method argument: lookup_from
(ARG002)
qdrant_client/async_qdrant_client.py
447-447: Unused method argument: lookup_from
(ARG002)
qdrant_client/qdrant_remote.py
255-255: Unused method argument: grpc_grace
(ARG002)
255-255: Unused method argument: kwargs
(ARG002)
857-857: Unused method argument: kwargs
(ARG002)
1915-1915: Unused method argument: kwargs
(ARG002)
2412-2412: Unused method argument: kwargs
(ARG002)
2468-2468: Unused method argument: kwargs
(ARG002)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - poetic-froyo-8baba7
- GitHub Check: Header rules - poetic-froyo-8baba7
- GitHub Check: Pages changed - poetic-froyo-8baba7
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
qdrant_client/local/async_qdrant_local.py (1)
748-751: PastOptionalNameError onmetadatalooks resolved; double‑check for any remainingOptionalThe
metadataparameter is now annotated astypes.Payload | None = None, which avoids the previousOptional[...]/missing import problem noted in earlier CI failures and review comments. Given the current file contents, there’s no remainingOptionalusage; if CI still reports aNameErrorforOptional, it’s worth grepping this file and the generator output to ensure there isn’t anotherOptional[...]annotation in a section not shown here or in a regenerated version.#!/bin/bash # From repo root: look for any remaining Optional usage in the async local client rg -n "Optional\[" qdrant_client/local/async_qdrant_local.py || echo "No Optional[...] usages found in async_qdrant_local.py"
🧹 Nitpick comments (7)
qdrant_client/local/qdrant_local.py (4)
173-190: Search and search-matrix signatures are consistent and safeThe updated annotations (
types.Filter | None,types.SearchParams | None,offset: int | None,with_payload/with_vectorsunions,score_threshold: float | None,using: str | None) align with HTTP/GRPC model types and the async/local counterparts. Runtime behavior is unchanged, and the optional parameters are simply forwarded toLocalCollection. The fact thatsearch_paramsisn’t used in local mode is acceptable for API parity with the remote client; Ruff’s ARG002 can be ignored here.Also applies to: 203-229
381-417:query_pointsandquery_points_groupssignatures match remote API and use new unions correctlyAll updated parameters (
query,using,prefetch,query_filter,search_params,offset,with_payload,with_vectors,score_threshold,lookup_from,with_lookup) now use PEP 604 unions and mirror the HTTP/async interfaces. The logic around_resolve_query_input,ignore_mentioned_ids_filter, and optionalwith_lookupcollections is unchanged and still guards lookups correctly. As withsearch,search_paramsremains unused in local mode for compatibility, which is expected.Also applies to: 442-497
724-746: Collection update/create/recreate and_collection_pathnow handle in‑memory mode explicitly
update_collection’s new optionalsparse_vectors_configandmetadatatypes (Mapping[str, types.SparseVectorParams] | None,types.Payload | None) align with the server API and are guarded byis not Nonechecks before mutating the collection config.Changing
_collection_pathto returnstr | Noneand guarding its uses (if collection_path is not None) indelete_collection,create_collection, andrecreate_collectionavoids filesystem operations for in‑memory (:memory:) instances and matches the async version. This is a good safety improvement with no downside for persistent stores.Also applies to: 748-752, 771-801
887-893: Payload index, snapshot, and sharding signatures: unions match server API while remaining unimplementedThe new optional types (
field_schema/field_type: types.PayloadSchemaType | None, snapshot methods returningtypes.SnapshotDescription | None, shard creation params as optional ints/lists) bring the local API in line with remote client interfaces. Since these methods either just warn (create_payload_index/delete_payload_index) or immediately raiseNotImplementedError, the behavior is unchanged and the broader typing surface is safe.Also applies to: 919-921, 954-956, 979-986
qdrant_client/local/async_qdrant_local.py (3)
162-190: Async search and search‑matrix signatures correctly adopt PEP 604 unionsThe updated annotations for
query_filter,search_params,offset,with_payload,with_vectors,score_threshold, andusing(X | Nonestyle) are in line with the HTTP and sync local APIs. The async wrappers still delegate straight toLocalCollection.search/search_matrix_*, so runtime behavior doesn’t change. As in the sync variant,search_paramsis intentionally ignored in local mode for API compatibility, so Ruff’s unused-argument warning can be safely suppressed here.Also applies to: 192-218
673-693: Collection update/create/recreate and_collection_pathhandle in‑memory mode correctly in async variantThe optional
sparse_vectors_configandmetadatatypes inupdate_collectionnow match the sync version, with safeis not Nonechecks before mutating._collection_pathreturningstr | Noneand guarded uses indelete_collection/create_collection/recreate_collectionensure no filesystem operations occur for:memory:collections, which is desirable and consistent across sync and async local clients.Also applies to: 695-699, 717-743, 745-756
823-838: Payload index, snapshot, and sharding async APIs: union typing matches sync/remote while staying unimplementedThe new optional fields (
field_schema/field_typeastypes.PayloadSchemaType | None, snapshot creators returningtypes.SnapshotDescription | None, shard creation args as optional ints/list) bringAsyncQdrantLocalin line with other async client surfaces. Since these methods only emit warnings or raiseNotImplementedError, the changes are strictly to the type surface.field_schema/field_typebeing unused is acceptable for future compatibility despite Ruff’s ARG002.Also applies to: 850-853, 855-861, 869-885, 887-891, 892-898, 913-924, 926-931, 933-937
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
qdrant_client/local/async_qdrant_local.py(26 hunks)qdrant_client/local/qdrant_local.py(27 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
qdrant_client/local/qdrant_local.py (4)
qdrant_client/grpc/points_pb2.pyi (41)
Filter(4532-4566)SearchParams(1424-1477)query(2899-2900)query(2971-2972)query(3112-3113)Query(2823-2880)lookup_from(1940-1941)lookup_from(2086-2087)lookup_from(2260-2261)lookup_from(2914-2915)lookup_from(3000-3001)lookup_from(3131-3132)LookupLocation(1862-1886)prefetch(2896-2897)prefetch(2968-2969)prefetch(3109-3110)order_by(1825-1826)order_by(2849-2850)OrderBy(1761-1786)PointId(249-271)points(661-661)points(707-708)points(802-803)points(1036-1037)points(3451-3451)points(3609-3610)points(3663-3664)points(3684-3685)points(4972-4973)points(5052-5052)vectors(562-562)vectors(845-846)vectors(875-876)vectors(1222-1222)vectors(1254-1254)vectors(1272-1272)vectors(1293-1293)vectors(3641-3642)vectors(3890-3891)vectors(4255-4255)vectors(5115-5115)qdrant_client/http/models/models.py (9)
Filter(914-924)SearchParams(2634-2652)LookupLocation(1540-1553)Prefetch(2023-2047)OrderBy(1839-1847)SparseVectorParams(3051-3061)VectorParams(3449-3474)PayloadSchemaType(1896-1911)SnapshotDescription(2886-2890)qdrant_client/grpc/collections_pb2.pyi (3)
SparseVectorParams(532-553)VectorParams(341-390)PayloadSchemaType(135-135)qdrant_client/local/async_qdrant_local.py (1)
_collection_path(695-699)
qdrant_client/local/async_qdrant_local.py (6)
qdrant_client/grpc/points_pb2.pyi (72)
Filter(4532-4566)SearchParams(1424-1477)with_payload(751-752)with_payload(1509-1510)with_payload(1614-1615)with_payload(1665-1666)with_payload(1813-1814)with_payload(1925-1926)with_payload(2073-2074)with_payload(2247-2248)with_payload(2991-2992)with_payload(3125-3126)with_vectors(754-755)with_vectors(1521-1522)with_vectors(1617-1618)with_vectors(1675-1676)with_vectors(1816-1817)with_vectors(1937-1938)with_vectors(2083-2084)with_vectors(2257-2258)with_vectors(2988-2989)with_vectors(3128-3129)query(2899-2900)query(2971-2972)query(3112-3113)Query(2823-2880)lookup_from(1940-1941)lookup_from(2086-2087)lookup_from(2260-2261)lookup_from(2914-2915)lookup_from(3000-3001)lookup_from(3131-3132)LookupLocation(1862-1886)prefetch(2896-2897)prefetch(2968-2969)prefetch(3109-3110)order_by(1825-1826)order_by(2849-2850)OrderBy(1761-1786)PointId(249-271)update_filter(669-670)update_filter(811-812)update_filter(3456-3457)update_filter(3615-3616)points(661-661)points(707-708)points(802-803)points(1036-1037)points(3451-3451)points(3609-3610)points(3663-3664)points(3684-3685)points(4972-4973)points(5052-5052)PointStruct(5082-5125)vectors(562-562)vectors(845-846)vectors(875-876)vectors(1222-1222)vectors(1254-1254)vectors(1272-1272)vectors(1293-1293)vectors(3641-3642)vectors(3890-3891)vectors(4255-4255)vectors(5115-5115)payload(936-937)payload(3497-3497)payload(3548-3548)payload(3883-3884)payload(4253-4253)payload(5113-5113)qdrant_client/http/models/models.py (10)
Filter(914-924)SearchParams(2634-2652)LookupLocation(1540-1553)Prefetch(2023-2047)OrderBy(1839-1847)Record(2323-2332)SparseVectorParams(3051-3061)VectorParams(3449-3474)PointStruct(1985-1988)SnapshotDescription(2886-2890)qdrant_client/qdrant_fastembed.py (1)
query(621-706)qdrant_client/async_qdrant_fastembed.py (1)
query(581-661)qdrant_client/grpc/collections_pb2.pyi (11)
sparse_vectors_config(1522-1523)sparse_vectors_config(1630-1631)sparse_vectors_config(1740-1741)SparseVectorParams(532-553)metadata(1528-1529)metadata(1636-1637)metadata(1853-1854)vectors_config(1510-1511)vectors_config(1624-1625)vectors_config(1729-1730)VectorParams(341-390)qdrant_client/local/qdrant_local.py (2)
_collection_path(748-752)_upload_points(825-842)
🪛 GitHub Actions: Integration tests
qdrant_client/local/async_qdrant_local.py
[error] 943-943: NameError: name 'Optional' is not defined (likely missing import from typing).
🪛 Ruff (0.14.4)
qdrant_client/local/qdrant_local.py
184-184: Unused method argument: search_params
(ARG002)
388-388: Unused method argument: search_params
(ARG002)
461-461: Unused method argument: search_params
(ARG002)
508-508: Unused method argument: kwargs
(ARG002)
891-891: Unused method argument: field_schema
(ARG002)
892-892: Unused method argument: field_type
(ARG002)
qdrant_client/local/async_qdrant_local.py
173-173: Unused method argument: search_params
(ARG002)
354-354: Unused method argument: search_params
(ARG002)
421-421: Unused method argument: search_params
(ARG002)
467-467: Unused method argument: kwargs
(ARG002)
763-763: Unused method argument: kwargs
(ARG002)
827-827: Unused method argument: field_schema
(ARG002)
828-828: Unused method argument: field_type
(ARG002)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - poetic-froyo-8baba7
- GitHub Check: Header rules - poetic-froyo-8baba7
- GitHub Check: Pages changed - poetic-froyo-8baba7
🔇 Additional comments (12)
qdrant_client/local/qdrant_local.py (5)
9-17: Typing imports and_flock_fileannotation look correctUsing
Unionalongside PEP 604 unions is fine in 3.10+ and still required for the largeUnion[...]inquery_points_groups. The explicitself._flock_file: TextIOWrapper | Nonematches the actual usage (open()+portalocker.unlock/.close()guarded byis not Noneand.closed) and improves static checking without changing behavior.Also applies to: 64-66
231-237: Query resolution helpers’ typing changes preserve invariantsAllowing
query: types.Query | None,using: str | None, andlookup_from: types.LookupLocation | None, plus the broaderprefetch: Sequence[types.Prefetch] | types.Prefetch | None, reflects actual usage patterns. Call sites never passquery=Noneinto_resolve_query_input(they guard withif query is not Noneor early-return in_resolve_prefetch_input), so the internaldeepcopy(query)andisinstancechain remain safe. The prefetch normalization still produces a cleanlist[types.Prefetch]and keepsNoneentries filtered out.Also applies to: 262-287, 334-359
499-529: Scroll / count / facet typing updates align with backend expectationsSwitching to
scroll_filter: types.Filter | None,order_by: types.OrderBy | None,offset: types.PointId | None, and returningtuple[list[types.Record], types.PointId | None]reflects the actual shapes returned byLocalCollection.scroll. Likewise,count_filter: types.Filter | Noneandfacet_filter: types.Filter | Nonematch the filter model types. Forwarding these values unchanged into the collection methods preserves existing behavior.Also applies to: 530-541
542-563: Upsert/update/retrieve/payload APIs: unionized filters and selectors are soundThe conversion of
update_filtertotypes.Filter | None, along withwith_payload/with_vectorsunions and an optionalkey: str | Noneinset_payload, is consistent with the HTTP models and other client surfaces. All these values are simply forwarded toLocalCollection, so there’s no functional change, and the new type hints should make static usage clearer.Also applies to: 575-585, 600-610
815-885: Upload helpers’ widened types remain compatible withLocalCollection.upsertAllowing
_upload_pointsto acceptIterable[types.PointStruct | types.Record]matches how records are represented in the HTTP models, and the comprehension uses onlyid,vector, andpayloadattributes that both types expose. Theupload_collectionchanges (vectorsunions,payload/idsoptional) are purely type-level; the logic converting dicts ofnp.ndarrayto lists of plain Python types and zippingids,vectors, andpayloadis unchanged and remains correct.qdrant_client/local/async_qdrant_local.py (7)
20-21: Imports and_flock_filetyping in async local client are consistentKeeping
Unionin the imports is necessary for the largeUnion[...]used in e.g.query_points_groups, and works fine in 3.10+. The_flock_file: TextIOWrapper | Noneannotation mirrors the sync version and matches how the lock file is opened, locked, unlocked, and closed in__init__,_load, andclose, improving type safety without changing behavior.Also applies to: 49-67
220-227: Query and prefetch resolution helpers match sync semantics with updated typingAllowing
query: types.Query | None,using: str | None, andlookup_from: types.LookupLocation | Nonein_resolve_query_input, plusSequence[types.Prefetch] | types.Prefetch | Nonein_resolve_prefetches_input, is consistent with the sync implementation and HTTP models. Callers never passquery=Noneinto_resolve_query_input, and prefetch handling still flattens nested prefetches and filters outNoneentries. The changes here are type-only and keep the behavior identical.Also applies to: 249-268, 312-331
347-381:query_pointsandquery_batch_pointsasync interfaces line up with sync/local and HTTPThe
query_pointssignature now uses PEP 604 unions forquery,using,prefetch,query_filter,search_params,offset,with_payload,with_vectors,score_threshold, andlookup_from, matching bothAsyncQdrantBaseand the syncQdrantLocal. The logic around_resolve_query_inputandignore_mentioned_ids_filteris unchanged, andoffset or 0still correctly defaults to 0 without altering existing semantics.query_batch_pointsjust forwards fields fromtypes.QueryRequest, so the type changes above are the key surface and they look consistent.Also applies to: 382-401
402-457:query_points_groupsasync typing matches the sync method and HTTP modelsThe union for
queryand the new PEP 604 unions onusing,prefetch,query_filter,search_params,with_payload,with_vectors,score_threshold,with_lookup, andlookup_frommirror the sync implementation and the higher-level client APIs. Resolution ofwith_lookupintowith_lookup_collectionremains unchanged and guards both str and structured inputs correctly.
458-478: Scroll, count, and facet async signatures are updated safely
scroll_filter,order_by,offset, and the returnedtuple[list[types.Record], types.PointId | None]now use the union syntax consistent with the sync version.count_filterandfacet_filterlikewise usetypes.Filter | None. All these values continue to be forwarded directly intoLocalCollection, so this is a type-surface modernization only.Also applies to: 479-488, 489-500
501-522: Async upsert/update/retrieve/payload methods: filters and selectors use new unions correctlyThe updated
update_filter: types.Filter | None,with_payload/with_vectorsunions, andkey: str | Noneinset_payloadmirror the sync local API and remote async clients. Methods still delegate straight toLocalCollection, and_default_update_resultremains the same, so there are no behavioral changes—only clearer, 3.10+ style typing.Also applies to: 523-543, 558-569
758-783: Upload helpers in async local client mirror sync behavior with broader typingAllowing
_upload_pointsto takeIterable[types.PointStruct | types.Record]and wideningupload_collection’svectors/payload/ids/update_filtertypes makes the async local surface match the sync local one. The conversion of dict-of-np.ndarrayinputs to lists of plain types and the UUID generation for missing IDs are unchanged. The additional unions are type-only and do not affect runtime behavior.Also applies to: 784-821
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (5)
qdrant_client/conversions/conversion.py (2)
2123-2136: ConvertUnionto PEP 604 union syntax (|).This method still uses the old
Unionsyntax, butUnionwas removed from the imports at line 3. This causes theNameErrorreported in the pipeline failures.Apply this diff to use the modern union syntax:
@classmethod def convert_cluster_operations( cls, - model: Union[ - grpc.MoveShard, - grpc.ReplicateShard, - grpc.AbortShardTransfer, - grpc.Replica, - grpc.CreateShardKey, - grpc.DeleteShardKey, - grpc.RestartTransfer, - grpc.ReplicatePoints, - ], + model: ( + grpc.MoveShard + | grpc.ReplicateShard + | grpc.AbortShardTransfer + | grpc.Replica + | grpc.CreateShardKey + | grpc.DeleteShardKey + | grpc.RestartTransfer + | grpc.ReplicatePoints + ), ) -> rest.ClusterOperations:
4629-4641: ConvertUnionto PEP 604 union syntax (|).This method's return type still uses the old
Unionsyntax, butUnionwas removed from the imports at line 3. This causes theNameErrorreported in the pipeline failures.Apply this diff to use the modern union syntax:
@classmethod def convert_cluster_operations( cls, model: rest.ClusterOperations - ) -> Union[ - grpc.MoveShard, - grpc.ReplicateShard, - grpc.AbortShardTransfer, - grpc.Replica, - grpc.CreateShardKey, - grpc.DeleteShardKey, - grpc.RestartTransfer, - grpc.ReplicatePoints, - ]: + ) -> ( + grpc.MoveShard + | grpc.ReplicateShard + | grpc.AbortShardTransfer + | grpc.Replica + | grpc.CreateShardKey + | grpc.DeleteShardKey + | grpc.RestartTransfer + | grpc.ReplicatePoints + ):qdrant_client/qdrant_client.py (1)
2462-2467: Fix:Optionalis not imported but used here.The pipeline failure indicates that
Optionalis used on lines 2465-2466 but is not imported. Either importOptionalfromtypingor convert to theX | Nonesyntax used elsewhere in this file.def remove_peer( self, peer_id: int, - force: Optional[bool] = None, - timeout: Optional[int] = None, + force: bool | None = None, + timeout: int | None = None, **kwargs: Any, ) -> bool:qdrant_client/qdrant_remote.py (1)
2625-2631: Fix:Optionalis not imported but used here.The pipeline failure indicates that
Optionalis used on lines 2628-2629 but is not imported. Either importOptionalfromtypingor convert to theX | Nonesyntax used elsewhere in this file.def remove_peer( self, peer_id: int, - force: Optional[bool] = None, - timeout: Optional[int] = None, + force: bool | None = None, + timeout: int | None = None, **kwargs: Any, ) -> bool:qdrant_client/async_qdrant_client.py (1)
421-452: Wirelookup_fromthrough to the underlying client inquery_points_groups
lookup_fromis exposed in theAsyncQdrantClient.query_points_groupssignature but never forwarded to_client.query_points_groups, so the argument is ignored.Forward it alongside the other parameters:
- return await self._client.query_points_groups( + return await self._client.query_points_groups( collection_name=collection_name, query=query, prefetch=prefetch, query_filter=query_filter, search_params=search_params, group_by=group_by, limit=limit, group_size=group_size, with_payload=with_payload, with_vectors=with_vectors, score_threshold=score_threshold, using=using, - with_lookup=with_lookup, - consistency=consistency, + with_lookup=with_lookup, + lookup_from=lookup_from, + consistency=consistency, shard_key_selector=shard_key_selector, timeout=timeout, **kwargs, )
🧹 Nitpick comments (5)
qdrant_client/local/async_qdrant_local.py (2)
175-176: Unused parameters (search_params,kwargs,field_schema,field_type) and Ruff ARG002The parameters flagged by Ruff (
search_paramsinsearch,query_points,query_points_groups, various**kwargs, andfield_schema/field_typeincreate_payload_index) are intentionally unused here but required for API parity with the remote client and base interfaces. To keep lint clean without breaking the public signature, consider adjusting the generator to either (a) insert small no-op uses, e.g.del search_params, kwargs/del field_schema, field_type, or (b) mark this autogenerated file (or these functions) with a# ruff: noqa: ARG002directive.Also applies to: 357-357, 424-424, 470-470, 766-766, 830-831
223-314: Internal query/prefetch helpers: optionalquerytyping vs. runtime expectations
_resolve_query_inputis now typed as acceptingquery: types.Query | None, but the body assumes a non-Nonequery(e.g., unguardeddeepcopy(query)andisinstancechecks); current internal call sites always pass a non-Nonequery, so behavior is correct, but the annotation slightly over-promises. Either narrowing the type back totypes.Queryor adding a fast-path forquery is None(and reflecting that in the return type) would make the helper’s contract clearer while preserving current usage.Also applies to: 315-348, 350-383, 405-459
pyproject.toml (1)
16-23: Remove stale numpy constraint for Python <3.10.With
python = ">=3.10"on line 16, the numpy constraint on line 20 (python = "<3.10") will never match and is now dead configuration. Consider removing it to avoid confusion.[tool.poetry.dependencies] python = ">=3.10" httpx = { version = ">=0.20.0", extras = ["http2"] } numpy = [ { version = ">=2.1.0", python = ">=3.13" }, - { version = ">=1.21,<2.1.0", python = "<3.10" }, { version = ">=1.21", python = ">=3.10,<3.12" }, { version = ">=1.26", python = ">=3.12,<3.13" }, ]qdrant_client/conversions/common_types.py (1)
131-132: Update stale comment referencing Python 3.7.The comment mentions "while we support python3.7" but the minimum Python version is now 3.10. Consider updating or removing this outdated reference.
# we can't use `nptyping` package due to numpy/python-version incompatibilities -# thus we need to define precise type annotations while we support python3.7 +# thus we need to define precise type annotationsqdrant_client/local/qdrant_local.py (1)
64-65: Local client typing updates look consistent; unused params can stay for API parityThe migration to
T | Noneand widened unions for filters/configs/metadata acrossQdrantLocal(e.g.,query_points,query_points_groups,scroll,update_collection,create_collection,upload_collection, andcreate_payload_index) matches the async/sync remote and base types and keeps the local API surface aligned.Ruff’s ARG002 warnings (
search_params,field_schema,field_type, and somekwargs) are all on parameters that are intentionally ignored in local mode but required for public‑API compatibility; it’s reasonable to keep them as‑is. If you want to silence the linter later, you can either prefix them with_or configure Ruff to ignore ARG002 in this module.Also applies to: 180-209, 388-425, 731-754, 778-821, 851-893, 894-909
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
poetry.lockis excluded by!**/*.lock
📒 Files selected for processing (12)
pyproject.toml(1 hunks)qdrant_client/async_client_base.py(14 hunks)qdrant_client/async_qdrant_client.py(40 hunks)qdrant_client/async_qdrant_remote.py(67 hunks)qdrant_client/client_base.py(15 hunks)qdrant_client/conversions/common_types.py(3 hunks)qdrant_client/conversions/conversion.py(11 hunks)qdrant_client/local/async_qdrant_local.py(26 hunks)qdrant_client/local/qdrant_local.py(27 hunks)qdrant_client/qdrant_client.py(40 hunks)qdrant_client/qdrant_remote.py(65 hunks)tests/test_qdrant_client.py(0 hunks)
💤 Files with no reviewable changes (1)
- tests/test_qdrant_client.py
🧰 Additional context used
🧬 Code graph analysis (5)
qdrant_client/conversions/common_types.py (2)
qdrant_client/grpc/points_pb2.pyi (1)
SearchParams(1399-1452)qdrant_client/grpc/qdrant_common_pb2.pyi (1)
PointId(21-38)
qdrant_client/async_qdrant_remote.py (4)
qdrant_client/async_qdrant_client.py (2)
close(158-165)query_batch_points(209-249)qdrant_client/qdrant_client.py (2)
close(172-179)query_batch_points(226-268)qdrant_client/qdrant_remote.py (3)
close(255-276)_parse_url(279-287)query_batch_points(552-597)qdrant_client/http/api/search_api.py (2)
query_batch_points(533-548)query_batch_points(756-771)
qdrant_client/local/qdrant_local.py (1)
qdrant_client/local/async_qdrant_local.py (1)
_collection_path(698-702)
qdrant_client/async_client_base.py (3)
qdrant_client/async_qdrant_client.py (2)
search_matrix_pairs(584-628)scroll(676-743)qdrant_client/client_base.py (2)
search_matrix_pairs(21-30)scroll(100-111)qdrant_client/local/local_collection.py (2)
search_matrix_pairs(1586-1607)scroll(1871-1905)
qdrant_client/local/async_qdrant_local.py (1)
qdrant_client/local/qdrant_local.py (2)
_collection_path(755-759)_upload_points(832-849)
🪛 GitHub Actions: Integration tests
qdrant_client/conversions/conversion.py
[error] 2126-2126: NameError: name 'Union' is not defined. Ensure typing.Union is imported (e.g., from typing import Union).
🪛 GitHub Actions: type-checkers
qdrant_client/qdrant_client.py
[error] 2465-2466: mypy: Name 'Optional' is not defined. Did you forget to import it from 'typing'?
qdrant_client/conversions/conversion.py
[error] 2126-2126: mypy: Name 'Union' is not defined. Did you forget to import it from 'typing'?
[error] 4632-4632: mypy: Name 'Union' is not defined. Did you forget to import it from 'typing'?
qdrant_client/qdrant_remote.py
[error] 2628-2629: mypy: Name 'Optional' is not defined. Did you forget to import it from 'typing'?
qdrant_client/async_qdrant_remote.py
[error] 2440-2441: mypy: Name 'Optional' is not defined. Did you forget to import it from 'typing'?
qdrant_client/async_qdrant_client.py
[error] 2338-2339: mypy: Name 'Optional' is not defined. Did you forget to import it from 'typing'?
🪛 Ruff (0.14.7)
qdrant_client/qdrant_client.py
471-471: Unused method argument: lookup_from
(ARG002)
qdrant_client/qdrant_remote.py
255-255: Unused method argument: grpc_grace
(ARG002)
255-255: Unused method argument: kwargs
(ARG002)
857-857: Unused method argument: kwargs
(ARG002)
1915-1915: Unused method argument: kwargs
(ARG002)
2412-2412: Unused method argument: kwargs
(ARG002)
2468-2468: Unused method argument: kwargs
(ARG002)
qdrant_client/async_qdrant_remote.py
201-201: Unused method argument: kwargs
(ARG002)
752-752: Unused method argument: kwargs
(ARG002)
1754-1754: Unused method argument: kwargs
(ARG002)
2220-2220: Unused method argument: kwargs
(ARG002)
2278-2278: Unused method argument: kwargs
(ARG002)
qdrant_client/local/qdrant_local.py
191-191: Unused method argument: search_params
(ARG002)
395-395: Unused method argument: search_params
(ARG002)
468-468: Unused method argument: search_params
(ARG002)
515-515: Unused method argument: kwargs
(ARG002)
898-898: Unused method argument: field_schema
(ARG002)
899-899: Unused method argument: field_type
(ARG002)
qdrant_client/async_qdrant_client.py
447-447: Unused method argument: lookup_from
(ARG002)
qdrant_client/local/async_qdrant_local.py
176-176: Unused method argument: search_params
(ARG002)
357-357: Unused method argument: search_params
(ARG002)
424-424: Unused method argument: search_params
(ARG002)
470-470: Unused method argument: kwargs
(ARG002)
766-766: Unused method argument: kwargs
(ARG002)
830-830: Unused method argument: field_schema
(ARG002)
831-831: Unused method argument: field_type
(ARG002)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - poetic-froyo-8baba7
- GitHub Check: Header rules - poetic-froyo-8baba7
- GitHub Check: Pages changed - poetic-froyo-8baba7
🔇 Additional comments (16)
qdrant_client/local/async_qdrant_local.py (9)
20-21: Module-level typing changes look consistentSwitching to
TextIOWrapper | Nonefor_flock_fileand trimmingtypingimports to what’s actually used is consistent with the rest of the file and Python 3.10+ style; no issues from a correctness or API standpoint.Also applies to: 65-67
165-183: Search and matrix-search signatures now use consistent optional/union typingThe updated annotations for
search,search_matrix_offsets, andsearch_matrix_pairs(e.g.,types.Filter | None,str | None, enrichedwith_payload/with_vectorsunions, and optionalscore_threshold) align with the rest of the client API and keep behavior unchanged by simply forwarding these parameters to the underlyingLocalCollection. Looks good.Also applies to: 195-207, 209-221
461-481:scrollannotation updates match underlying behaviorThe new typing for
scroll(scroll_filter: types.Filter | None,order_by: types.OrderBy | None,offset: types.PointId | None, and the return typetuple[list[types.Record], types.PointId | None]) accurately describes existing behavior and mirrors the sync local client; no functional change introduced.
482-503:countandfacetfilter annotations modernized correctlyUsing
types.Filter | Noneforcount_filterandfacet_filterbrings these signatures in line with the rest of the API and with the underlying collection methods; the delegations (collection.count/collection.facet) are unchanged, so this is a safe typing-only improvement.
504-525:upsert/update_vectorsoptionalupdate_filtertyping is appropriateAnnotating
update_filterastypes.Filter | Nonein bothupsertandupdate_vectorsmatches how the value is passed through tocollection.upsert/collection.update_vectorsand keeps the API surface consistent with other filter-taking methods.
537-547: Payload/vector union typings onretrieveandset_payloadThe richer unions on
with_payload/with_vectors(bool | Sequence[str] | types.PayloadSelector) and the optionalkey: str | Noneforset_payloadmatch the rest of the client APIs and underlying collection expectations. The forwarding logic is unchanged and remains correct.Also applies to: 561-571
676-697: Collection config and path annotations align with sync local client
sparse_vectors_config: Mapping[str, types.SparseVectorParams] | Noneandmetadata: types.Payload | Noneinupdate_collection,create_collection, andrecreate_collectioncorrectly reflect that these fields are optional and are already guarded withis not Nonechecks or safedeepcopyusage._collection_path’s return typestr | Nonematches the actual behavior and the synchronousQdrantLocalimplementation, and all call sites already handleNonedefensively (if collection_path is not None:).
These changes improve type accuracy without changing runtime behavior.Also applies to: 698-703, 720-746, 748-759
761-769: Upload helpers’ updated typings match actual accepted inputs
upload_points/_upload_pointsnow explicitly typeupdate_filterastypes.Filter | Noneand_upload_points’spointsasIterable[types.PointStruct | types.Record], which matches how both structs are used (point.id,point.vector,point.payload).upload_collection’svectors/payload/idsannotations (dict[str, types.NumpyArray] | types.NumpyArray | Iterable[types.VectorStruct],Iterable[dict[Any, Any]] | None,Iterable[types.PointId] | None) accurately describe the existing branching logic andzipusage.
No behavioral issues here; signatures are now clearer and better aligned with real inputs.Also applies to: 770-785, 787-824
826-841: Index/snapshot/shard-key methods: optional typings consistent with “not supported” semanticsThe updated optional typings in
create_payload_index(field_schema/field_type), snapshot-related methods (create_snapshot,create_shard_snapshotreturningtypes.SnapshotDescription | None), andcreate_shard_key(shards_number/replication_factor/placementas optional) align with the remote client’s surface, while all of these methods still immediately raiseNotImplementedError(or return simple defaults), so there’s no runtime behavior change. The annotations simply make the local async client’s interface match the broader client API more precisely.Also applies to: 858-864, 872-912, 916-927
qdrant_client/conversions/common_types.py (2)
6-6: LGTM!The
TypeAliasimport is now correctly sourced directly fromtypingfor Python 3.10+, which is cleaner than the previous conditional import pattern.
44-77: LGTM!The type aliases have been properly modernized to use Python 3.10+ union syntax (
X | Y) with explicitTypeAliasannotations. This aligns with PEP 604 and the PR's goal of dropping Python 3.9 support.qdrant_client/qdrant_client.py (1)
83-103: LGTM!The
__init__method signature has been properly updated to use Python 3.10+ union syntax (X | None) consistently across all optional parameters.qdrant_client/qdrant_remote.py (2)
48-62: LGTM!The
__init__method signature has been properly updated to use Python 3.10+ union syntax for all optional parameters, consistent with the PR's modernization effort.
6-16: LGTM!The typing imports are correctly structured.
Unionis retained for complex union types used in method signatures (e.g.,queryparameter), while the simpler nullable types use theX | Nonesyntax.qdrant_client/client_base.py (1)
1-4: Base client PEP 604 typing update is consistent with implementationsThe switch to
T | Noneacross the base interface (filters, offsets, lookup_from, snapshot methods, shard‑key helpers, andmigrate/upload_collection/create_payload_index) matches the corresponding async/sync and local/remote implementations and keeps the public API surface coherent.No behavioral changes are introduced here; this looks good as a shared contract for the concrete clients.
Also applies to: 40-111, 254-286, 288-360, 365-372
qdrant_client/async_client_base.py (1)
12-13: Async base interface typing matches async client/remote implementationsThe move to PEP 604 unions in
AsyncQdrantBase(nullable filters, offsets, lookup_from,vectors_config, snapshot/shard methods,migrate/create_shard_key, etc.) is consistent withAsyncQdrantClientandAsyncQdrantRemote, and keeps the async interface in sync with the syncQdrantBase.Given these are abstract methods raising
NotImplementedError, there’s no runtime risk; the new signatures improve type safety without affecting behavior.Also applies to: 47-118, 243-272, 274-336, 341-347, 350-359
| import uuid | ||
| from datetime import date, datetime, timezone | ||
| from typing import Any, Mapping, Optional, Sequence, Union, get_args | ||
| from typing import Any, Mapping, Sequence, get_args |
There was a problem hiding this comment.
Critical: Union removed from imports but still used in the code.
The removal of Union from the import statement is incomplete. The code still uses Union at lines 2126 and 4632, which will cause NameError at runtime. This is confirmed by the pipeline failures.
Apply this diff to restore the import temporarily until all usages are converted:
-from typing import Any, Mapping, Sequence, get_args
+from typing import Any, Mapping, Sequence, Union, get_argsNote: The proper fix is to convert the remaining Union usages to the new | syntax (see comments on lines 2126 and 4632), then remove the import.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| from typing import Any, Mapping, Sequence, get_args | |
| from typing import Any, Mapping, Sequence, Union, get_args |
🤖 Prompt for AI Agents
In qdrant_client/conversions/conversion.py around line 3, the typing import
removed Union but the code still references Union at lines 2126 and 4632 causing
NameError; restore Union into the from typing import (...) list (i.e., add Union
back to the import on line 3) to immediately fix the runtime error, then follow
up by converting the remaining Union usages at lines 2126 and 4632 to the newer
"|" union syntax and remove the import when done.
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
qdrant_client/async_qdrant_client.py (1)
421-582: Forwardlookup_fromto_client.query_points_groupsto avoid silently ignoring itIn
query_points_groups(Lines 421‑582), the new/annotated parameterlookup_from: types.LookupLocation | None = Noneis:
- Documented in the docstring.
- Not used anywhere in the function body.
- Not forwarded to
self._client.query_points_groups(...).This both triggers Ruff’s ARG002 (“Unused method argument:
lookup_from”) and means user‑suppliedlookup_fromis silently ignored, which is a behavioral bug.You should pass it through to the underlying client (ideally via the generator template, given this file is autogenerated). For example:
- return await self._client.query_points_groups( - collection_name=collection_name, - query=query, - prefetch=prefetch, - query_filter=query_filter, - search_params=search_params, - group_by=group_by, - limit=limit, - group_size=group_size, - with_payload=with_payload, - with_vectors=with_vectors, - score_threshold=score_threshold, - using=using, - with_lookup=with_lookup, - consistency=consistency, - shard_key_selector=shard_key_selector, - timeout=timeout, - **kwargs, - ) + return await self._client.query_points_groups( + collection_name=collection_name, + query=query, + prefetch=prefetch, + query_filter=query_filter, + search_params=search_params, + group_by=group_by, + limit=limit, + group_size=group_size, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + using=using, + with_lookup=with_lookup, + lookup_from=lookup_from, + consistency=consistency, + shard_key_selector=shard_key_selector, + timeout=timeout, + **kwargs, + )
🧹 Nitpick comments (1)
qdrant_client/conversions/conversion.py (1)
839-859: Convertshard_key_selectorparameter usingconvert_shard_key_selectorbefore passing to REST models
PointIdsListandFilterSelectorREST models expectshard_key: Optional["ShardKeySelector"](REST type), butconvert_points_selectorpasses the gRPCshard_key_selectorparameter directly without conversion. This creates a type mismatch with REST models.For consistency with
convert_query_points(lines 1416–1422), which properly converts viacls.convert_shard_key_selector()before assigning to REST fields, apply the same conversion here.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
qdrant_client/async_qdrant_client.py(41 hunks)qdrant_client/async_qdrant_remote.py(68 hunks)qdrant_client/conversions/conversion.py(13 hunks)qdrant_client/hybrid/formula.py(3 hunks)qdrant_client/hybrid/fusion.py(1 hunks)qdrant_client/local/order_by.py(1 hunks)qdrant_client/qdrant_client.py(41 hunks)qdrant_client/qdrant_remote.py(66 hunks)tests/embed_tests/test_local_inference.py(1 hunks)tests/test_local_persistence.py(2 hunks)tests/test_qdrant_client.py(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (5)
qdrant_client/local/order_by.py (1)
qdrant_client/grpc/points_pb2.pyi (1)
OrderValue(3808-3823)
tests/test_qdrant_client.py (3)
qdrant_client/http/models/models.py (2)
PointVectors(1991-1993)StrictModeConfig(3084-3129)qdrant_client/grpc/points_pb2.pyi (1)
PointVectors(811-829)qdrant_client/grpc/collections_pb2.pyi (1)
StrictModeConfig(1237-1361)
qdrant_client/qdrant_client.py (6)
qdrant_client/async_qdrant_client.py (1)
close(158-165)qdrant_client/async_qdrant_remote.py (1)
close(201-222)qdrant_client/qdrant_remote.py (1)
close(255-276)qdrant_client/client_base.py (1)
close(362-363)qdrant_client/local/qdrant_local.py (1)
close(72-91)qdrant_client/http/api_client.py (2)
close(56-57)close(139-140)
qdrant_client/async_qdrant_client.py (2)
qdrant_client/qdrant_client.py (1)
close(172-179)qdrant_client/async_client_base.py (1)
close(338-339)
qdrant_client/conversions/conversion.py (5)
qdrant_client/async_qdrant_remote.py (1)
rest(347-353)qdrant_client/qdrant_remote.py (1)
rest(408-414)qdrant_client/grpc/points_pb2.pyi (17)
shard_key_selector(641-642)shard_key_selector(688-689)shard_key_selector(735-736)shard_key_selector(783-784)shard_key_selector(856-857)shard_key_selector(920-921)shard_key_selector(973-974)shard_key_selector(1017-1018)shard_key_selector(1504-1505)shard_key_selector(1665-1666)shard_key_selector(1797-1798)shard_key_selector(1847-1848)shard_key_selector(1931-1932)shard_key_selector(2084-2085)shard_key_selector(2243-2244)shard_key_selector(2335-2336)ShardKeySelector(590-613)qdrant_client/grpc/collections_pb2.pyi (8)
MoveShard(2669-2697)ReplicateShard(2701-2729)AbortShardTransfer(2733-2755)Replica(2816-2829)CreateShardKey(2833-2869)DeleteShardKey(2873-2886)RestartTransfer(2759-2784)ReplicatePoints(2788-2812)qdrant_client/grpc/qdrant_common_pb2.pyi (2)
conditions(98-98)Condition(110-147)
🪛 Ruff (0.14.7)
qdrant_client/qdrant_client.py
471-471: Unused method argument: lookup_from
(ARG002)
qdrant_client/qdrant_remote.py
255-255: Unused method argument: grpc_grace
(ARG002)
255-255: Unused method argument: kwargs
(ARG002)
857-857: Unused method argument: kwargs
(ARG002)
1915-1915: Unused method argument: kwargs
(ARG002)
2412-2412: Unused method argument: kwargs
(ARG002)
2468-2468: Unused method argument: kwargs
(ARG002)
qdrant_client/async_qdrant_client.py
447-447: Unused method argument: lookup_from
(ARG002)
qdrant_client/async_qdrant_remote.py
201-201: Unused method argument: kwargs
(ARG002)
752-752: Unused method argument: kwargs
(ARG002)
1754-1754: Unused method argument: kwargs
(ARG002)
2220-2220: Unused method argument: kwargs
(ARG002)
2278-2278: Unused method argument: kwargs
(ARG002)
2438-2438: Unused method argument: kwargs
(ARG002)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: Redirect rules - poetic-froyo-8baba7
- GitHub Check: Header rules - poetic-froyo-8baba7
- GitHub Check: Pages changed - poetic-froyo-8baba7
- GitHub Check: Python 3.12.x on ubuntu-latest test
- GitHub Check: Python 3.11.x on ubuntu-latest test
- GitHub Check: Python 3.13.x on ubuntu-latest test
- GitHub Check: Python 3.10.x on ubuntu-latest test
🔇 Additional comments (30)
tests/test_local_persistence.py (2)
15-19: LGTM! Type annotation correctly modernized.The function signature correctly adopts PEP 604 union syntax (
str | None), which is equivalent to the previousOptional[str]annotation and aligns with the PR's objective to require Python 3.10+.
45-51: LGTM! Consistent type annotation modernization.The function signature correctly adopts PEP 604 union syntax (
str | None), matching the pattern used iningest_dense_vector_dataand fulfilling the Python 3.10+ requirement.qdrant_client/hybrid/fusion.py (1)
7-11: PEP 604 union annotation looks correct and consistentThe
ranking_constant_k: int | None = Noneannotation is valid for Python 3.10+, matches the project-wide Optional→PEP 604 migration, and does not affect runtime behavior ofreciprocal_rank_fusion.qdrant_client/hybrid/formula.py (1)
6-6: LGTM! Type annotations correctly modernized to Python 3.10+ syntax.The changes appropriately update type hints to use PEP 604 union syntax and built-in generic types:
- Removed
UnionandTuplefrom imports (line 6)- Changed
Tuple[float, float, float, float]totuple[float, float, float, float](line 223)- Changed
Union[str, int]tostr | int(line 301)These are annotation-only changes with no runtime impact, correctly aligned with dropping Python 3.9 support.
Also applies to: 223-223, 301-301
tests/embed_tests/test_local_inference.py (1)
123-123: LGTM! Clean modernization to PEP 604 syntax.The type annotation correctly adopts Python 3.10+ union syntax (
str | None), which is semantically equivalent toOptional[str]. This change aligns with the PR objective to drop Python 3.9 support.qdrant_client/local/order_by.py (1)
13-13: Type annotations successfully modernized to PEP 604 syntax.The function signature now correctly uses the modern union syntax (
str | datetime | OrderValue | Nonefor the parameter andOrderValue | Nonefor the return type), and theOptionalandUnionimports have been removed. This addresses the previous review feedback and aligns with the PR's objective to modernize type annotations for Python 3.10+.qdrant_client/conversions/conversion.py (6)
3-3: Import cleanup:typing.Unionremoval is now safeAll remaining
Union[...]annotations have been migrated toA | Bsyntax; there are no runtime references toUnion, so dropping it from the imports is correct and fixes the earlier NameError risk.
639-645: Range handling annotations now match actual usageTyping
range_asrest.RangeInterface | Noneandconvert_datetimeasdatetime | datealigns annotations with the two concrete range variants (numeric vs datetime) you already handle. No behavior change, just clearer, PEP‑604‑style types.Also applies to: 2679-2693
990-1003: Vector conversion unions are internally consistent after PEP 604 migrationThe updated annotations for
_convert_vector,convert_vector,convert_vector_output, the innerconvert_vectorhelpers inconvert_vector_struct/convert_vector_struct_output, andconvert_named_vector_structcorrectly describe the possible dense, multi‑dense, sparse, and document/image/object variants flowing through these paths. The use ofgrpc.*types in_convert_vectorand REST types in the public converters is coherent with the implementation.Also applies to: 1040-1049, 1067-1069, 3482-3497, 3524-3540, 3579-3593
2124-2134:GrpcToRest.convert_cluster_operationsunion parameter type looks goodThe parameter type is now expressed as a PEP‑604 union over the supported gRPC cluster operation messages, matching the
isinstancedispatch below and improving readability without changing behavior.
2648-2667:convert_filter’s helper now properly documents list-or-single inputTyping
conditionsaslist[rest.Condition] | rest.Conditionmatches the existing normalization logic (if not isinstance(conditions, list): conditions = [conditions]). This is a clean, annotation‑only improvement.
4628-4639:RestToGrpc.convert_cluster_operationsreturn union matches branch coverageThe return type is now an explicit union of the eight possible gRPC cluster operation messages, in line with the
isinstancebranches below. This makes the bidirectional cluster conversion API symmetrical with theGrpcToRestside.qdrant_client/async_qdrant_remote.py (2)
47-62: Constructor and gRPC setup typings look consistent with runtime behaviorThe migration to
T | Nonein the constructor (url,port,https,api_key,prefix,timeout,host,grpc_options,auth_token_provider,pool_size) and internal attributes (_pool_size,_timeout,_grpc_compression, gRPC stub pools) matches how these values are used:
portandhostare allowed to beNoneand are normalized later depending onurlvshost, which the tests already exercise.timeoutremains an optional int, with_timeoutfalling back toDEFAULT_GRPC_TIMEOUTand being passed both to httpx and gRPC calls without changing control flow.grpc_compression: Compression | Noneand the subsequent type/enum checks preserve previous semantics while tightening the annotation.Given this file is autogenerated, the changes are appropriately minimal and keep behavior intact.
Also applies to: 70-71, 133-152, 167-171
469-471:result | Nonepattern with explicitassertis soundThe updated annotation
result: models.QueryResponse | None = query_result.resultfollowed byassert result is not Nonebefore returning is a good way to reflect the OpenAPI client'sOptional[...]result while keeping the public method’s return type non‑optional.This pattern appears consistently in other methods (
query_batch_points,scroll,count,facet, various update/delete helpers, and collection/alias operations) and is correct from both typing and runtime perspectives.tests/test_qdrant_client.py (1)
20-20: No action needed. BothPointVectorsandStrictModeConfigare concrete Pydantic model classes in the REST models, and the type aliases inconversions/common_types.pysimply re-export them. They are fully callable as constructors at runtime.Likely an incorrect or invalid review comment.
qdrant_client/qdrant_client.py (1)
85-102: LGTM! Type annotations modernized consistently.The constructor parameters have been updated to use PEP 604 union syntax (
X | None), which is the recommended approach for Python 3.10+. All changes are consistent and improve type clarity.qdrant_client/qdrant_remote.py (3)
50-62: LGTM! Constructor type annotations modernized.The constructor parameters have been consistently updated to use PEP 604 union syntax. The changes improve type clarity and are appropriate for the Python 3.10+ requirement.
255-276: LGTM! Signature consistent with async version.The
grpc_graceparameter is unused in the synchronous implementation but is used in the async version (as shown in the code snippets). Keeping it here maintains API consistency between sync and async clients, which is good design.
548-550: LGTM! More accurate return typing.The explicit
models.QueryResponse | Nonereturn type is more accurate than the previous typing, correctly reflecting that the API call result can be None before the assertion. This improves type safety.qdrant_client/async_qdrant_client.py (11)
12-166: Constructor andclosetyping updates look consistent with the rest of the client surface
- Import list (Line 13) and
__init__parameter annotations (Lines 85‑103) correctly reflectNonedefaults viaT | Noneand use built‑in generics (dict[str, Any], etc.).AsyncQdrantClient.close(Lines 158‑165) now takesgrpc_grace: float | None = Noneand forwards it toself._client.close, matching the sync client’sclosesignature inqdrant_client/qdrant_client.py(Lines 171‑178 of that file).
No functional issues spotted here; changes are annotation‑only and improve static typing accuracy.
209-419: Batch and single query wrapper annotations are accurate and fully forwardedFor
query_batch_points(Lines 209‑249) andquery_points(Lines 251‑419):
- Newly
None‑able parameters (consistency,timeout,using,prefetch, filters, thresholds, etc.) are correctly annotated with| None.- All these parameters are passed through to the underlying
_clientmethods, so the public async wrapper remains a thin, accurately typed layer.- Embedding / inference logic around
queryandprefetchremains unchanged.No issues beyond typing modernization.
584-675: Matrix search helpers: type changes are coherent and correctly propagatedFor
search_matrix_pairsandsearch_matrix_offsets(Lines 584‑675):
query_filter,using,consistency,timeout, andshard_key_selectorare now annotated with| None, matching their documented semantics.- All such parameters are passed directly to
_client.search_matrix_pairs/_client.search_matrix_offsets.No functional changes beyond stricter typing; looks good.
676-833: Scroll, count, and facet wrappers: updated annotations match usageIn
scroll,count, andfacet(Lines 676‑833):
- Filter, ordering, shard selection, and timeout parameters are upgraded to
T | Nonewhere they can be omitted.scroll’s return typetuple[list[types.Record], types.PointId | None]matches the documented “(list, optional offset)” behavior.- All newly annotated parameters are forwarded unchanged to the underlying
_clientmethods.No issues observed.
835-1410: Mutation APIs (upsert/update/delete/payload/batch) have consistent| NonetypingAcross
upsert,update_vectors,delete_vectors,delete,set_payload,overwrite_payload,delete_payload,clear_payload, andbatch_update_points(Lines 835‑1410):
ordering,shard_key_selector,update_filter, and optionalkeyare correctly typed as... | Nonewhile preserving existing defaults.- All of these arguments are forwarded to the corresponding
_clientmethods.- The embedding / inference paths for points and update operations are unchanged.
These changes are annotation‑only and align with how the parameters are used.
1411-1561: Collection alias and collection update/delete typing changes are soundFor
update_collection_aliases,update_collection, anddelete_collection(Lines 1411‑1561):
timeoutand other configuration parameters (optimizers_config,collection_params,vectors_config,hnsw_config,quantization_config,sparse_vectors_config,strict_mode_config,metadata) are marked as| None, which matches their optional semantics in the docstrings.- The guard on
"optimizer_config"vs.optimizers_configinupdate_collectionis unchanged; the updated typing does not alter that behavior.- All parameters are passed through to
_clientwith the same names.Looks correct and consistent with the rest of the API.
1563-1740: Collection creation/recreation: optional config typing matches behaviorIn
create_collectionandrecreate_collection(Lines 1563‑1740):
- Vector, sparse vector, sharding, replication, on‑disk, index, optimizer, WAL, quantization, timeout, strict mode, and metadata parameters are now properly typed as optional (
... | None) with defaults ofNone.- Calls to
_client.create_collection/_client.recreate_collectionforward all these parameters by name, so runtime behavior is unchanged.- Deprecation warning for
recreate_collectionremains intact.The typing updates here are coherent and do not introduce functional changes.
1742-1881: Bulk upload helpers: vector/payload/id typing and options are alignedFor
upload_pointsandupload_collection(Lines 1742‑1881):
method,shard_key_selector, andupdate_filterare now... | None, reflecting their optional use.vectorsinupload_collectionis now a union ofIterable[types.VectorStruct] | dict[str, types.NumpyArray] | types.NumpyArray, matching the runtime checks (isinstance(vectors, dict)/np.ndarray) and embedding path.- All annotated options are forwarded directly to
_client.upload_points/_client.upload_collection.No correctness issues detected.
1883-1958: Payload index management: modernizedorderingtyping onlyIn
create_payload_indexanddelete_payload_index(Lines 1883‑1958):
field_schema/field_typeandorderingare now typed using... | None, while defaults and behavior remain the same.- Parameters are forwarded 1:1 to the underlying client methods.
These are straightforward type‑hint modernizations.
1960-2233: Snapshot and shard‑snapshot APIs: return/argument unions look correctFor collection snapshots, full snapshots, and shard snapshots (
list_*,create_*,delete_*,recover_*; Lines 1960‑2233):
- Return types that can be absent are now explicitly annotated as
types.SnapshotDescription | Noneorbool | None, which matches the documented “wait or not” semantics.- Optional parameters (
api_key,checksum,priority) use... | Noneand are consistently forwarded to_client.- Assertion guards on
kwargsare preserved.These changes improve type precision without altering behavior.
2225-2349: Shard key and cluster management methods, includingremove_peer, are correctly updatedFor
create_shard_key,cluster_collection_update,collection_cluster_info,cluster_status,recover_current_peer, andremove_peer(Lines 2225‑2349):
- Optional parameters like
shards_number,replication_factor,placement, andtimeoutare now annotated with| Noneand are passed through appropriately.remove_peernow usesforce: bool | None = Noneandtimeout: int | None = None, and forwards them as keyword arguments to_client.remove_peer, addressing the earlier “Optional not imported” issue and aligning with the rest of the PEP‑604 style.Everything here looks consistent and functionally correct.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (11)
qdrant_client/local/local_collection.py (11)
283-303: Keep_resolve_query_vector_namesignature, comment, and unions in syncThe expanded
query_vectorunion (includingSparseQueryVector,MultiQueryVector, etc.) matches the downstreamisinstancebranches, but the comment just below still says “SparseQueryVector is not in the method's signature,” which is now stale.Consider updating the comment (or extracting a shared alias for the large union) to avoid confusion for future readers.
409-465:with_payload/with_vectorstyping vs runtime behaviorThe annotations now use
bool | Sequence[str] | types.PayloadSelector, but:
_process_payloadspecial-caseslistrather than genericSequence, so a tuple of fields will currently fall through and return the full payload, not a filtered view._get_vectorstreatswith_vectorsasbool | Sequence[str] | Nonebut call sites generally passboolorlist[str], so behavior is unchanged.If you want annotations to reflect actual accepted shapes, either:
- Narrow types to
bool | list[str] | types.PayloadSelector, or- Normalize non-list
Sequence[str]tolistat the top of_process_payload/_get_vectors.This is purely a typing contract issue; runtime behavior is unchanged.
498-521: Usetypes.Filterconsistently in_payload_and_non_deleted_maskThe parameter is annotated as
models.Filter | None, while most call sites are typed astypes.Filter | None. At runtime this is fine (the value is just passed through tocalculate_payload_mask), but the mismatch is slightly confusing for type-checkers and readers.Consider annotating this as
types.Filter | Nonefor consistency with callers.
533-554: Complexquery_vectorunion insearchcould benefit from a shared aliasThe
searchsignature now mirrors_resolve_query_vector_namewith a very large explicit union of dense, sparse, multi, and named vector shapes. This matches the internal logic and is an improvement in explicitness, but it’s hard to read and maintain.You might want to introduce a single exported alias (e.g.
types.SearchVectorInput) and use it in bothsearchand_resolve_query_vector_nameto reduce duplication.
701-807: Broadenprefetchtyping inquery_points/_merge_sourcesto match actual behavior
query_pointsnow annotatesprefetch: list[types.Prefetch] | None, but the implementation still handles both a singlePrefetchand a list:prefetches = prefetch if isinstance(prefetch, list) else [prefetch]Similarly,
set_prefetch_limit_iterativelyacceptstypes.Prefetch | list[types.Prefetch].For consistency and to avoid type-checker false positives when users pass a single
Prefetch, consider changing the signature to:prefetch: types.Prefetch | list[types.Prefetch] | None = NoneNo runtime bug here; just a type-level contract mismatch.
871-881:_query_collectiondefaultwith_payload=Falseis unused but consistentThe default for
with_payloadis nowFalse, but all internal callers pass an explicit value. This doesn’t change behavior and is consistent with_sample_randomly/searchdefaults.No action strictly required; just noting that the default is effectively unused and could be dropped or tightened later if you want to reduce API surface.
995-1056:query_groups/search_groupstyping is consistent; minor note onwith_payloadThe updated types (
queryas a broad union of input formats,with_payload: bool | Sequence[str] | types.PayloadSelector, andwith_lookup_collection: "LocalCollection | None") line up with actual usage and grouping logic.As in
_process_payload,with_payloadis annotated asSequence[str]but onlylistis handled specially before falling back to full payload. If you want to support tuples or other sequences, a small normalization step (if not isinstance(with_payload, list): with_payload = list(with_payload)) would make the implementation match the annotation.
1235-1330: Filters returned from_preprocess_recommend_inputcan still beNone
_preprocess_recommend_inputis annotated to returntypes.Filteras its last tuple element, but:
- The input
query_filteristypes.Filter | None.ignore_mentioned_ids_filtercan return the originalquery_filterunchanged whenmentioned_idsis empty.So the returned
query_filtercan still beNone. The current call sites (e.g._construct_recommend_query,recommend,recommend_groups) pass it into APIs that accepttypes.Filter | None, so this is only a typing inconsistency.Consider changing the return type to
types.Filter | None(and similarly for_construct_recommend_querybelow) to better reflect actual behavior.
1384-1465:_construct_recommend_queryfilter return type is too narrowSame concern as above: the return annotation uses
types.Filter, butedited_query_filtercan beNoneif no ids were mentioned and the originalquery_filterwasNone.Since
recommendpassesedited_query_filterstraight intosearch(query_filter=...), which allowsNone, updating the return annotation totypes.Filter | Nonewould better match reality and avoid confusing type-checkers.
1659-1762:_preprocess_target/_preprocess_discover: filter return type can beNoneThe new signatures and return types correctly capture vector/ContextPair variants, but:
_preprocess_discoveris annotated to returntypes.Filterin its last position.- It calls
ignore_mentioned_ids_filter, which can returnNonewhen no ids are mentioned and the inputquery_filterisNone.Callers like
discoverpass this intosearch, which acceptstypes.Filter | None, so this is only a typing mismatch. As with the recommend path, consider changing the return totypes.Filter | None.
2806-2851:ignore_mentioned_ids_filter/_include_ids_in_filterreturn types can beNoneBoth helpers are annotated as returning
types.Filter, but:
- If
mentioned_ids/idsis empty, they immediatelyreturn query_filter, which may beNone.- Callers such as
_preprocess_recommend_input,_construct_recommend_query, and_preprocess_discoverthen propagate this filter into methods that explicitly accepttypes.Filter | None.To keep typing honest and avoid surprising
mypybehavior, consider changing the return annotations totypes.Filter | None(and updating the dependent helper signatures that currently promise a non-optionaltypes.Filteras discussed above).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
qdrant_client/local/async_qdrant_local.py(26 hunks)qdrant_client/local/local_collection.py(46 hunks)qdrant_client/local/qdrant_local.py(26 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-05-14T20:18:46.258Z
Learnt from: joein
Repo: qdrant/qdrant-client PR: 977
File: tests/congruence_tests/test_payload.py:645-651
Timestamp: 2025-05-14T20:18:46.258Z
Learning: In the Qdrant client, there is no separate `models.OverwritePayload` class. The `models.OverwritePayloadOperation` class is designed to accept a `models.SetPayload` object as its `overwrite_payload` parameter.
Applied to files:
qdrant_client/local/local_collection.py
🧬 Code graph analysis (3)
qdrant_client/local/async_qdrant_local.py (1)
qdrant_client/local/qdrant_local.py (2)
_collection_path(750-754)_upload_points(827-844)
qdrant_client/local/qdrant_local.py (1)
qdrant_client/local/async_qdrant_local.py (1)
_collection_path(694-698)
qdrant_client/local/local_collection.py (3)
qdrant_client/http/models/models.py (5)
NamedVector(1700-1706)NamedSparseVector(1691-1697)SparseVector(2988-2994)RecommendStrategy(2310-2320)ContextPair(449-451)qdrant_client/local/distances.py (2)
RecoQuery(18-35)ContextPair(38-44)qdrant_client/local/multi_distances.py (1)
MultiRecoQuery(15-35)
🪛 Ruff (0.14.7)
qdrant_client/local/async_qdrant_local.py
174-174: Unused method argument: search_params
(ARG002)
355-355: Unused method argument: search_params
(ARG002)
420-420: Unused method argument: search_params
(ARG002)
466-466: Unused method argument: kwargs
(ARG002)
762-762: Unused method argument: kwargs
(ARG002)
826-826: Unused method argument: field_schema
(ARG002)
827-827: Unused method argument: field_type
(ARG002)
qdrant_client/local/qdrant_local.py
188-188: Unused method argument: search_params
(ARG002)
392-392: Unused method argument: search_params
(ARG002)
463-463: Unused method argument: search_params
(ARG002)
510-510: Unused method argument: kwargs
(ARG002)
893-893: Unused method argument: field_schema
(ARG002)
894-894: Unused method argument: field_type
(ARG002)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: Redirect rules - poetic-froyo-8baba7
- GitHub Check: Header rules - poetic-froyo-8baba7
- GitHub Check: Pages changed - poetic-froyo-8baba7
- GitHub Check: Python 3.13.x on ubuntu-latest test
- GitHub Check: Python 3.12.x on ubuntu-latest test
- GitHub Check: Python 3.10.x on ubuntu-latest test
- GitHub Check: Python 3.11.x on ubuntu-latest test
🔇 Additional comments (16)
qdrant_client/local/async_qdrant_local.py (1)
1-936: LGTM! Type annotation modernization is consistent throughout the autogenerated file.The conversion from
Optional[T]toT | Noneand union syntax modernization has been applied consistently across all method signatures. Since this is an autogenerated file (as indicated by the header), these changes correctly reflect the updates made to the generator script.The past review concern about the missing
Optionalimport has been addressed in commit deb986a.qdrant_client/local/qdrant_local.py (1)
1-1043: LGTM! Type annotations successfully modernized to Python 3.10+ syntax.The file has been consistently updated with PEP 604 union syntax throughout:
- Field annotations (line 63:
TextIOWrapper | None)- Method parameters and return types using
T | Noneinstead ofOptional[T]- Union types using
A | BsyntaxThe changes mirror those in the async version and maintain API compatibility while adopting modern Python typing conventions.
qdrant_client/local/local_collection.py (14)
100-149:__init__typing update looks consistent with existing behaviorSwitching
locationtostr | Nonealigns with actual usage (self.persistent = location is not Noneand conditionalCollectionPersistence). No behavior change introduced here.
1159-1167:facet_filternow usestypes.Filter | None— consistent with other entry pointsUsing
types.Filter | Nonehere and then delegating to_payload_and_non_deleted_maskkeeps the filtering path aligned withsearch/scroll. No behavior change introduced.Looks good.
1209-1214:retrievetyping forwith_payload/with_vectorsmatches helpersThe updated types (bool |
Sequence[str]|types.PayloadSelectorforwith_payload, andbool | Sequence[str]forwith_vectors) now match_get_payloadand_get_vectors. This clarifies the API without changing behavior.All good here.
1468-1521:recommend/recommend_groupsnew type hints align with internal machineryThe broadened unions on
positive/negative,query_filter: types.Filter | None,using: str | None, and the strategy defaults all match how_construct_recommend_queryand_preprocess_recommend_inputoperate. No behavior change here.Good cleanup; only follow‑up is the filter return-type suggestion already mentioned.
1548-1611: Search matrix helpers:using/ filter typing is coherent
query_filter: types.Filter | Noneandusing: str | Nonepropagate cleanly through to_search_distance_matrix, then intoself._sample_randomlyandself.search. The contract remains unchanged; this is just modernized typing.No issues spotted.
1796-1857:discovertyping matches underlying preprocessing and searchThe updated optional parameters (
target,context,query_filter,using, lookup options, andscore_threshold) reflect how_preprocess_discoverandsearchare used. The intermediatequery_vectorannotation (DenseQueryVector | SparseQueryVector | MultiQueryVector) is accurate and helps static tools.Looks correct overall; no behavior change.
1867-1952:scroll/_scroll_by_id/_scroll_by_valuefilter & selector types are consistent
scroll_filter: types.Filter | Noneandorder_by: types.OrderBy | Nonealign with howcalculate_payload_maskandOrderByare used.offset: types.PointId | Nonefor_scroll_by_idaccurately models both string and int ids.with_payload/with_vectorsannotations now match_get_payload/_get_vectors.No functional changes; typing is in line with actual logic.
2019-2052:_sample_randomlytyping matches usageThe updated
query_filter: types.Filter | None,with_payload, andwith_vectorstypes are consistent with other entry points and the helpers they call. No behavioral changes introduced.Looks good.
2054-2201: MMR helpers: updated vector and filter typings reflect reality
_search_with_mmrnow explicitly annotatesquery_vectoras(list[float] | SparseVector | list[list[float]]), which matches how_mmrconsumes it.query_filter: types.Filter | Noneandoffset: int | Noneare consistent with the surrounding search APIs._mmr'squery_vectorannotation is aligned with its internal shape-handling branches.I don’t see any behavior change here; the MMR logic is unchanged.
2407-2495: Upsert path:update_filtertyping and vector handling remain correct
_upsert_pointandupsertnow acceptupdate_filter: types.Filter | None, which matches howcheck_filteris used.- The validation of sparse vectors and the check against
self._all_vectors_keysare unchanged.- The batch path still builds
vectordicts per-id as before.This is all consistent with previous behavior (and with the past learning about
OverwritePayloadOperationusingSetPayloadsemantics inbatch_update_pointslater in the file).
2507-2562:_update_named_vectors/update_vectorsvector type hints improvedThe new signature:
self, idx: int, vectors: dict[str, list[float] | SparseVector | list[list[float]]]matches how
_update_named_vectorsbranches between dense, sparse, and multivector updates.update_vectorsnormalizesvector_struct(list vs dict) as before.No functional changes; the annotations now better describe the accepted shapes.
2564-2627: Selector unions fordelete_vectors/_selector_to_ids/deletelook correctUsing a shared selector union:
models.Filter | list[models.ExtendedPointId] | models.FilterSelector | models.PointIdsListacross
delete_vectors,_selector_to_ids, anddeleteimproves clarity and keeps the logic centralized in_selector_to_ids. This matches howbatch_update_pointsconstructs selectors.No behavior change here.
2638-2711: Payload operations: selector andkeytypings match actual behavior
set_payload,overwrite_payload,delete_payload, andclear_payloadall use the same selector union, which is good.key: str | Nonepluskeys: list[JsonPathItem] | None = parse_json_path(key) if key is not None else Noneaccurately reflects the JSONPath-based update behavior.Everything here is consistent with previous semantics.
2865-2890: Iterativeset_prefetch_limit_iterativelylooks correct and avoids recursionThe new stack-based implementation:
- Correctly handles both a single
types.Prefetchand nested lists ofPrefetch.- Mirrors the recursive behavior (set
limiton each Prefetch, then walk itsprefetchfield), but without recursion depth concerns.- Uses
types.Prefetch | list[types.Prefetch]in both the parameter and the internal stack typing.This is a nice internal cleanup; behavior stays the same.
tbung
left a comment
There was a problem hiding this comment.
I think you missed some, at least
Also, https://github.com/qdrant/pydantic_openapi_v3 probably should be updated to generate >3.9 type hints as well, if we care about that. That'd certainly help with finding anything we missed with grep or something.
There was a problem hiding this comment.
I guess we can drop this numpy version specifier.
| @@ -1,4 +1,4 @@ | |||
| from typing import Tuple, Callable, Any, Union | |||
| from typing import Tuple, Callable, Any | |||
There was a problem hiding this comment.
Tuple has been depracated in favor of bultin tuple since 3.9. This might be a good chance to drop those too. See also https://docs.python.org/3/library/typing.html#deprecated-aliases
There was a problem hiding this comment.
wondering how I missed all that...
thanks
Yeah, but it might be trickier, probably sometime later.. |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
qdrant_client/async_qdrant_client.py (1)
419-578:lookup_frominquery_points_groupsis accepted but never used
query_points_groupsexposeslookup_from: types.LookupLocation | None, documents it, and static analysis flags it as unused; the value is not forwarded to_client.query_points_groups, so callers cannot actually influence the lookup location through this method.You should pass it through to keep behavior consistent with
query_pointsand the remote client:return await self._client.query_points_groups( collection_name=collection_name, query=query, prefetch=prefetch, query_filter=query_filter, search_params=search_params, group_by=group_by, limit=limit, group_size=group_size, with_payload=with_payload, with_vectors=with_vectors, score_threshold=score_threshold, using=using, with_lookup=with_lookup, - consistency=consistency, - shard_key_selector=shard_key_selector, - timeout=timeout, + lookup_from=lookup_from, + consistency=consistency, + shard_key_selector=shard_key_selector, + timeout=timeout, **kwargs, )Since this file is autogenerated, the fix should be applied in the generator (
tools/generate_async_client.sh) and the client regenerated.qdrant_client/qdrant_client.py (1)
443-606:lookup_frominquery_points_groupsis accepted but never used
query_points_groupsexposes alookup_fromparameter and documents it, but the value is not forwarded toself._client.query_points_groups, so any caller-providedlookup_fromis silently ignored. This is a real behavior bug and also matches the static analysis warning about an unused argument.I’d wire it through to the underlying client:
- return self._client.query_points_groups( - collection_name=collection_name, - query=query, - prefetch=prefetch, - query_filter=query_filter, - search_params=search_params, - group_by=group_by, - limit=limit, - group_size=group_size, - with_payload=with_payload, - with_vectors=with_vectors, - score_threshold=score_threshold, - using=using, - with_lookup=with_lookup, - consistency=consistency, - shard_key_selector=shard_key_selector, - timeout=timeout, - **kwargs, - ) + return self._client.query_points_groups( + collection_name=collection_name, + query=query, + prefetch=prefetch, + query_filter=query_filter, + search_params=search_params, + group_by=group_by, + limit=limit, + group_size=group_size, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + using=using, + lookup_from=lookup_from, + with_lookup=with_lookup, + consistency=consistency, + shard_key_selector=shard_key_selector, + timeout=timeout, + **kwargs, + )
🧹 Nitpick comments (3)
qdrant_client/async_qdrant_remote.py (1)
201-223: Unused**kwargsin autogenerated methods are benignRuff’s ARG002 on unused
kwargsin methods likeclose,scroll,delete_collection,recover_snapshot,recover_shard_snapshot, andremove_peerstems from the commonAsyncQdrantBaseinterface—callers assertlen(kwargs) == 0in higher-level clients, so these remain intentionally unused here. You can safely ignore or suppress these in the generator if you want a cleaner lint run, but no runtime issue is present.Also applies to: 736-748, 1749-1752, 2216-2221, 2274-2277, 2433-2435
qdrant_client/async_client_base.py (1)
12-113: Async base interface matches concrete clients for new unions, with one minor mismatchThe shift to explicit
... | Nonein filters, offsets, payload/vector flags, snapshot methods, shard operations, and migration args is consistent with the async remote/client implementations and doesn’t affect behavior. The only minor typing discrepancy is thatcreate_collection/recreate_collectionrequire a non‑optionalvectors_config, whileAsyncQdrantClientandAsyncQdrantRemoteacceptvectors_config | None; if you rely on strict type checking, consider adding| Nonehere as well.Also applies to: 239-268, 270-332, 337-352
qdrant_client/client_base.py (1)
1-107: Sync base type updates are consistent; considervectors_config | Nonefor parityThe migration to
| Nonefor filters, offsets, payload/vector selectors, snapshot methods, shard config, and migration parameters matches the concrete sync client behaviors and keeps the abstract interface aligned with current usage. As withAsyncQdrantBase,create_collection/recreate_collectionhere still require non‑nullablevectors_config, whereas higher‑level clients acceptvectors_config | None; optionally broadening the base signature would avoid minor typing friction.Also applies to: 155-162, 250-265, 274-332, 361-379
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (13)
qdrant_client/async_client_base.py(14 hunks)qdrant_client/async_qdrant_client.py(41 hunks)qdrant_client/async_qdrant_fastembed.py(19 hunks)qdrant_client/async_qdrant_remote.py(68 hunks)qdrant_client/client_base.py(15 hunks)qdrant_client/qdrant_client.py(41 hunks)qdrant_client/qdrant_fastembed.py(19 hunks)qdrant_client/qdrant_remote.py(64 hunks)tests/congruence_tests/test_group_search.py(2 hunks)tests/congruence_tests/test_multivector_recommend_queries.py(1 hunks)tests/congruence_tests/test_query.py(3 hunks)tests/congruence_tests/test_recommendation.py(1 hunks)tests/utils.py(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- qdrant_client/qdrant_fastembed.py
🧰 Additional context used
🧬 Code graph analysis (6)
tests/congruence_tests/test_group_search.py (1)
qdrant_client/http/models/models.py (1)
NamedVector(1700-1706)
qdrant_client/client_base.py (2)
qdrant_client/async_client_base.py (3)
search_matrix_pairs(31-40)scroll(103-114)count(116-123)qdrant_client/local/local_collection.py (3)
search_matrix_pairs(1582-1603)scroll(1867-1901)count(1903-1906)
qdrant_client/async_qdrant_remote.py (1)
qdrant_client/qdrant_remote.py (2)
close(254-275)_parse_url(278-286)
qdrant_client/async_client_base.py (2)
qdrant_client/client_base.py (1)
search_matrix_pairs(21-30)qdrant_client/local/local_collection.py (1)
search_matrix_pairs(1582-1603)
qdrant_client/async_qdrant_client.py (2)
qdrant_client/async_qdrant_remote.py (1)
close(201-222)qdrant_client/qdrant_client.py (1)
close(171-178)
qdrant_client/qdrant_client.py (2)
qdrant_client/async_qdrant_remote.py (1)
close(201-222)qdrant_client/qdrant_remote.py (1)
close(254-275)
🪛 Ruff (0.14.7)
qdrant_client/qdrant_remote.py
254-254: Unused method argument: grpc_grace
(ARG002)
254-254: Unused method argument: kwargs
(ARG002)
852-852: Unused method argument: kwargs
(ARG002)
1910-1910: Unused method argument: kwargs
(ARG002)
2407-2407: Unused method argument: kwargs
(ARG002)
2463-2463: Unused method argument: kwargs
(ARG002)
qdrant_client/async_qdrant_remote.py
201-201: Unused method argument: kwargs
(ARG002)
748-748: Unused method argument: kwargs
(ARG002)
1750-1750: Unused method argument: kwargs
(ARG002)
2216-2216: Unused method argument: kwargs
(ARG002)
2274-2274: Unused method argument: kwargs
(ARG002)
2434-2434: Unused method argument: kwargs
(ARG002)
qdrant_client/async_qdrant_client.py
443-443: Unused method argument: lookup_from
(ARG002)
qdrant_client/qdrant_client.py
466-466: Unused method argument: lookup_from
(ARG002)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - poetic-froyo-8baba7
- GitHub Check: Header rules - poetic-froyo-8baba7
- GitHub Check: Pages changed - poetic-froyo-8baba7
🔇 Additional comments (22)
qdrant_client/async_qdrant_fastembed.py (1)
1-838: File is autogenerated — verify generator script was updated.This file is marked as autogenerated with instructions to regenerate via
bash -x tools/generate_async_client.sh. The type annotation changes fromOptional[T]/Union[A, B]toT | None/A | Bare correct for Python 3.10+ and consistent with the project's drop of Python 3.9 support.However, these changes must originate from the generator script itself (or its source template), not manual edits to this output file. Ensure the generator and/or the sync source file (
qdrant_client/qdrant_fastembed.py) were updated to produce these new annotations. If only this file was edited manually, the generator will overwrite these changes on the next run.tests/utils.py (1)
8-13: LGTM! Clean type annotation modernization.The return type and docstring have been properly updated to use Python 3.10+ union syntax (
int | None). This change is consistent with dropping Python 3.9 support.qdrant_client/qdrant_remote.py (3)
47-62: LGTM! Constructor signature properly modernized.The constructor parameters have been systematically updated to use Python 3.10+ union syntax. The type annotations are clear and consistent with the PR's objective to modernize type hints.
254-254: Note: Unused parameters are intentional.The static analysis tool flags
grpc_graceandkwargsas unused, but these parameters are part of the public API signature and maintain compatibility with client expectations. This is an acceptable design choice.
424-450: LGTM! Comprehensive query_points signature update.The extensive parameter list has been thoroughly updated with modern union syntax. The nullable type annotations are clear and properly applied throughout.
tests/congruence_tests/test_multivector_recommend_queries.py (1)
81-83: LGTM! Test method signature updated correctly.The optional parameter type has been properly modernized to use the
int | Nonesyntax, maintaining the same default value and semantics.tests/congruence_tests/test_recommendation.py (1)
62-64: LGTM! Consistent type annotation modernization.The parameter type has been updated to match the modern Python 3.10+ syntax, consistent with similar changes across other test files.
tests/congruence_tests/test_group_search.py (1)
36-43: LGTM! Union type properly converted to modern syntax.The multi-type parameter annotation has been cleanly updated to use the
|operator. The multi-line formatting maintains good readability for the complex type union.tests/congruence_tests/test_query.py (3)
1-1: LGTM! Import modernization addresses previous feedback.The deprecated
TupleandUniontype aliases have been removed, addressing the past review comment about using built-intupleinstead. The code now uses Python 3.10+ native syntax throughout.
789-791: LGTM! Return type modernized.The return type has been properly updated from
Union[models.QueryResponse, str]tomodels.QueryResponse | str, using the modern union syntax.
923-923: LGTM! Tuple type properly updated.The return type now uses the built-in
tupleinstead of the deprecatedTupletype alias, consistent with Python 3.10+ best practices.qdrant_client/async_qdrant_remote.py (2)
47-173: Constructor and connection setup changes look consistentThe widened
| Noneannotations for URL/host/ports, auth token provider, pool size, and the gRPC client pools align with existing runtime logic (including_https/_schemehandling, timeout ceiling, and channel pools) without changing behavior. Thecloseimplementation correctly accepts the newgrpc_grace: float | Noneand preserves prior shutdown semantics.Also applies to: 201-233
364-513: Optional.resulthandling and updated return types are soundThe new
T | Noneannotations for REST.resultvalues (e.g., query/query_batch, scroll, count/facet, collection update/create/delete, payload index APIs) combined with explicitassert result is not Nonewhere aNonewould be unexpected, and| Nonereturn types whereNoneis valid (snapshots and similar) accurately model the underlying API and keep observable behavior unchanged.Also applies to: 736-913, 1731-1763, 1848-1856, 2013-2088
qdrant_client/async_qdrant_client.py (8)
83-156: Constructor andclosecoroutine updated safelyThe async client’s
__init__now cleanly models nullable location/url/host/timeout/etc. and the broader auth token provider type without changing control flow, andasync def close(grpc_grace: float | None, **kwargs)correctly delegates to the underlying async client while staying consistent with the sync wrapper.Also applies to: 158-166
209-417: Core query/search APIs: type unions and forwarding look correct, except forlookup_fromin groupsThe expanded union‑typed parameters for
query_batch_points,query_points,query_points_groups, search‑matrix methods,scroll,count, andfacetalign with the async base/remote signatures, and all non‑derived arguments (filters, consistency, shard selectors, timeouts) are forwarded correctly to_client. The only exception islookup_frominquery_points_groups, which is accepted but not passed through (see separate comment).Also applies to: 419-578, 580-671, 672-779, 781-830
831-1406: Update/upsert/payload and batch operations: unions and forwarding are consistentThe updated annotations for
ordering,shard_key_selector,update_filter, and related flags inupsert,update_vectors,delete_vectors,set_payload,overwrite_payload,delete_payload,clear_payload, andbatch_update_pointsmatch the underlying async remote interface, and all parameters are forwarded correctly after optional local embedding, preserving existing semantics.
1407-1760: Collection and alias management methods correctly reflect nullable configsFor alias operations and collection lifecycle (
update_collection_aliases,get_*,update_collection,delete_collection,create_collection,recreate_collection), the introduction of| Noneon optimizer/collection/vector/HNSW/quantization/sparse/strict/metadata/timeouts and the corresponding forwarding logic to_clientaccurately mirror the remote API and prior behavior. The deprecation warning onrecreate_collectionremains intact.
1738-1877: Bulk upload helpers remain behaviorally unchanged under new typingThe synchronous
upload_pointsandupload_collectionwrappers now typemethod,shard_key_selector,update_filter,vectors,payload, andidswith| None, while the lazy embedding and dispatch to_client.upload_*are unchanged. The inference check andchainhelper still ensure the first item isn’t dropped when inspecting for embedding needs.
1879-1954: Payload index helpers correctly adopt nullable schema and ordering types
create_payload_indexanddelete_payload_indexnow acceptfield_schema: PayloadSchemaType | None,field_type: PayloadSchemaType | None, andordering: WriteOrdering | None, forwarding them directly to the remote client. This matches the underlying API’s behavior and keeps the higher-level docs in sync with the implementation.
1956-2219: Snapshot and shard‑snapshot methods now accurately model optional returns and paramsThe snapshot CRUD and recovery methods (
create_snapshot,delete_snapshot,create_full_snapshot,delete_full_snapshot,recover_snapshot, and their shard equivalents) have been updated toSnapshotDescription | None/bool | Noneand to accept optionalapi_key,checksum, andpriority, which aligns with the async remote implementations returning possibly‑None.resultvalues. Forwarding of all parameters, includingpriority, is correct.
2221-2345: Shard key and cluster administration APIs match new nullable config surfaceThe
create_shard_key,delete_shard_key,cluster_collection_update,collection_cluster_info,cluster_status,recover_current_peer, andremove_peermethods now expose the same| Nonetimeouts and shard parameters as the async remote, and simply delegate to_clientwithout altering behavior. The earlier issue aroundremove_peer’sforce/timeouttyping has been resolved with the newbool | None/int | Nonehints.qdrant_client/qdrant_client.py (1)
82-103: Init options and 3.10+ typing look consistentThe
__init__signature and_init_optionscapture still line up with the documented semantics (mutually exclusivelocation/url/host/path, cloud vs local inference, auth token provider, gRPC options). The move to PEP 604 unions (T | None) and built-in generics (dict[str, Any],list[str], etc.) is consistent and doesn’t introduce behavioral changes here.
* new: remove vectors_count, update http and grpc models * fix: update inspection cache * new: add conversions and update interface * fix: fix some conversions * fix: fix typo * fix: fix isinstance * fix: regen async * fix: fix update_filter usage, fix isinstance * tests: collection metadata test * fix: address backward compatibility in test * new: update models, add max payload index count and copy vectors * fix; update _inspection_cache * new: add read consistency to count points * Allow uuids in interface (#1085) * new: direct uuid support * tests: add uuid tests * fix: update inspection cache * new: add collection metadata and tests to local mode (#1089) * new: add collection metadata and tests to local mode * fix: regen async client * new: implement parametrized rrf in local mode (#1087) * new: implement parametrized rrf in local mode * refactoring: use a variable for a magic value * fix: adjust conversion according to AI * Update filter (#1090) * new: add missing update_filter, implement it in local mode * fix: fix type hint, fix update operation, fix rest uploader, add tests * fix: fix update filter is None case * fix: mypy was not a good boy * Text any filter (#1091) * new: add match text any local mode * tests: add match text any tests * new: update models, remove init_from and locks (#1100) * new: update models, remove init_from and locks * deprecate: remove init from tests * deprecate: remove lock tests * new: convert ascii_folding * fix: fix type stub * new: convert acorn * new: convert shard key with fallback * new: update grpcio and grpcio tools in generator (#1106) * new: update grpcio and grpcio tools in generator * fix: bind grpcio and tools versions to 1.62.0 in generator * Remove deprecated methods (#1103) * deprecate: remove old api methods * deprecate: remove type stub for removed methods * deprecate: remove old api methods from test_qdrant_client * deprecate: replace search with query points in test_in_memory * deprecate: replace search methods in fastembed mixin with query points * deprecate: replace old api methods in test async qdrant client * deprecate: replace search with query points in test delete points * deprecate: replace discover and context with query points in test_discovery * deprecate: replace recommend_groups with query_points_groups in test_group_recommend * deprecate: replace search_groups in test_group_search * deprecate: replace recommend with query points in test_recommendation * deprecate: replace search with query points in test search * deprecate: replace context and discover with query points in test sparse discovery * deprecate: replace search with query points in test sparse idf search * deprecate: replace recommend with query points in test sparse recommend * deprecate: replace search with query points in test sparse search * deprecate: replace missing search request with query request in qdrant_fastembed * deprecate: replace search with query points in test multivector search queries * deprecate: replace upload records with upload points in test_updates * deprecate: remove redundant structs (#1104) * deprecate: remove redundant structs * fix: do not use removed conversions in local mode * fix: remove redundant conversions, simplify types.QueryRequest * deprecate: replace old style grpc vector conversion to a new one (#1105) * deprecate: replace old style grpc vector conversion to a new one * fix: ignore union attr in conversion * review fixes --------- Co-authored-by: generall <[email protected]> --------- Co-authored-by: generall <[email protected]> --------- Co-authored-by: generall <[email protected]> * new: deprecate add, query, query_batch in fastembed mixin (#1102) * new: deprecate add, query, query_batch in fastembed mixin * 1.16 -> 1.17 --------- Co-authored-by: generall <[email protected]> --------- Co-authored-by: generall <[email protected]> * new: yet another update * new: add initial_state to create shard key (#1109) * new: drop python3.9, replace union and optional with | where possible * fix: fix missing type hints, regen async * fix: remove redundant optional * fix: fix ai comments * fix: update type hints from merge * new: update pyproject and lock * new: replace optional and union with | * new: remove optional and union from qdrant local * new: replace union with | in client classes * fix: replace remaining union, optional, etc, address review comments * new: adjust numpy versioning --------- Co-authored-by: generall <[email protected]>
No description provided.