Skip to content

Drop python3.9#1110

Merged
joein merged 36 commits into
devfrom
drop-python3.9
Dec 5, 2025
Merged

Drop python3.9#1110
joein merged 36 commits into
devfrom
drop-python3.9

Conversation

@joein

@joein joein commented Nov 13, 2025

Copy link
Copy Markdown
Member

No description provided.

joein and others added 23 commits October 29, 2025 16:39
* 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]>
@joein joein changed the base branch from update-models-1.16 to dev November 14, 2025 10:01
@netlify

netlify Bot commented Nov 14, 2025

Copy link
Copy Markdown

Deploy Preview for poetic-froyo-8baba7 ready!

Name Link
🔨 Latest commit 9f9c500
🔍 Latest deploy log https://app.netlify.com/projects/poetic-froyo-8baba7/deploys/693114f3ec027e00084a9455
😎 Deploy Preview https://deploy-preview-1110--poetic-froyo-8baba7.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Nov 14, 2025

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Modernized type annotations across the repository to Python 3.10+ PEP 604 union syntax (e.g., T | None, A | B), introduced TypeAlias in several modules, and removed many Optional/Union imports. Changes touch clients (sync/async), local/remote backends, embedders/fastembed, conversions, uploaders, tooling, tests, and CI workflows. Most edits are type-only. Two functional changes: BearerAuth now validates and dispatches sync vs async token providers at runtime, and read_base64 now raises FileNotFoundError for missing paths. CI: removed Python 3.9 from matrices and bumped pyproject Python minimum to >=3.10; integration-tests QDRANT_VERSION updated.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Areas to review closely:

  • BearerAuth runtime detection and sync/async token flows.
  • read_base64 behavior change (now raises FileNotFoundError).
  • CI/workflow edits and pyproject.toml Python version / numpy constraints changes.
  • Public API signatures for client classes (QdrantClient / Async variants) where return-type nullability changed.
  • Code-generation tooling (tools/async_client_generator) and any generated code consumers.

Possibly related PRs

Suggested reviewers

  • tbung
  • generall

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.98% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess whether it relates to the changeset. Add a description explaining why Python 3.9 support is being dropped and the scope of changes (e.g., type hint modernization to PEP 604 syntax).
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Drop python3.9' clearly describes the main change in the changeset: removing Python 3.9 support throughout the codebase.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch drop-python3.9

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb1591a and 9f9c500.

📒 Files selected for processing (3)
  • tests/congruence_tests/test_common.py (8 hunks)
  • tests/congruence_tests/test_query.py (3 hunks)
  • tests/test_qdrant_client.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/test_qdrant_client.py
🧰 Additional context used
🧬 Code graph analysis (1)
tests/congruence_tests/test_common.py (1)
qdrant_client/http/models/models.py (2)
  • VectorParams (3409-3434)
  • SparseVectorParams (3011-3021)
⏰ 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.10.x on ubuntu-latest test
  • GitHub Check: Python 3.11.x on ubuntu-latest test
  • GitHub Check: Python 3.12.x on ubuntu-latest test
🔇 Additional comments (5)
tests/congruence_tests/test_query.py (3)

1-1: Typing imports now match actual usage

Using typing.Callable and typing.Any only (dropping Union/Tuple) is consistent with the updated annotations and keeps this module clean.


785-787: score_boosting return annotation matches real outcomes

The new return type models.QueryResponse | str aligns with the function body: successful calls return a QueryResponse, while handled errors are normalized to strings via comparable_error. No behavioral change, just clearer typing.


919-919: Switch to tuple[...] fixes deprecated typing.Tuple usage

Annotating init_clients as tuple[QdrantClient, QdrantClient, QdrantClient] is correct for the actual return value and resolves the prior feedback about deprecated typing.Tuple/Union in this module.

tests/congruence_tests/test_common.py (2)

2-2: PEP 604 union updates in fixtures and init helpers look consistent

The updated annotations for vectors_config, sparse_vectors_config, num, and vectors_sizes (plus the str | None storage parameter) accurately model how these helpers are used (dicts, ints, or None) without changing behavior. Consolidating on builtin generics and union syntax is aligned with dropping Python 3.9.

Also applies to: 90-106, 114-129, 132-150, 153-170, 380-397


197-224: compare_vectors optionality accurately reflected in types

Annotating vec1/vec2 as VectorStruct | None matches the early-None return path and the way vectors are pulled from Record/ScoredPoint instances. No logic changes; type hints now simply reflect reality.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 references Optional[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 None
qdrant_client/hybrid/formula.py (1)

223-223: Complete the typing modernization by using lowercase tuple.

Line 223 still uses Tuple from the typing module, which is inconsistent with the PEP 604 modernization applied elsewhere. Python 3.10+ supports the built-in tuple type 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 Any
qdrant_client/hybrid/fusion.py (1)

1-1: Remove unused Optional import.

The Optional import 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 models
qdrant_client/conversions/conversion.py (1)

2035-2043: Remove is not None from the HasField check on line 2037.

The code at line 2037 is the only occurrence in the file where HasField() is followed by is not None. Since HasField() returns a boolean, the condition model.HasField("index") is not None is always True, 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 uses if 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 stray Optional usage in recreate_collection

Optional is no longer imported from typing, but metadata in recreate_collection still uses Optional[...], which is exactly what the mypy pipeline error reports. Update the annotation to use the new | None style instead of re‑introducing Optional.

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_collection with 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 unused type_params variable.

The type_params variable is assigned on line 26 but never used. If it should be passed to ast.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 for VectorOutput.

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.InferenceObject
  • convert_vector_output(...) -> list[float] | list[list[float]] | rest.SparseVector

are consistent with the protobuf stubs: Vector supports document/image/object, while VectorOutput only 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_vector so that the type of val is narrower when called with grpc.VectorOutput (today, _convert_vector’s return annotation still includes grpc.Document / grpc.Image / grpc.InferenceObject, which strict checkers may see as incompatible with the narrower convert_vector_output return type).

Also applies to: 1040-1049, 1067-1073

qdrant_client/connection.py (1)

240-255: Align parse_ssl_credentials docstring with updated return type

The function is now annotated as returning dict[str, bytes | None], while the docstring still mentions dict[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: Tighten check_min_should vector typing to reflect actual usage

check_min_should currently annotates vectors: dict[str, Any], but it’s always called with the same has_vector map used elsewhere (dict[str, bool]) and is passed straight into check_condition’s has_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 docstrings

Allowing:

  • 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 dict branch, and inference_batch_size remains 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 unused kwargs in Embedder.__init__

Static analysis correctly flags kwargs as unused here: __init__ only stores threads. If **kwargs is kept solely for API compatibility, consider either:

  • Renaming to _kwargs or 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 consistency

Since 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 Union import here.


73-85: Apply the same PEP 604 refactor here

Mirror 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 unused kwargs in autogenerated methods

Ruff 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: ARG002 at 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 passthrough

Alternatively, 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 signature

Align 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 Union from the imports if unused elsewhere in this module.


522-532: Docs still use Optional[...] phrasing

Non-blocking, but consider updating docstrings to reflect T | None terminology 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 hints

If 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_groups typings and with_lookup resolution are coherent

New union annotations for using, prefetch, query_filter, search_params, with_payload, with_vectors, score_threshold, with_lookup, and lookup_from correctly reflect the different accepted shapes, and the with_lookup_collection resolution logic remains unchanged. One minor gap: search_params is accepted but not forwarded to collection.query_groups, so the parameter is effectively ignored.

If you decide to address this later, consider passing search_params through:

-        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_path returning str | None—behavior change looks intentional

_collection_path now returns None when self.persistent is False, and callers (e.g., delete_collection, create_collection) are already checking for is not None before 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 LocalCollection can handle location=None for in‑memory usage (both here and in async_qdrant_local) to ensure no regressions in ":memory:" mode. -->

qdrant_client/qdrant_client.py (1)

445-611: query_points_groups doesn’t forward lookup_from to the underlying client

Typing updates are fine, but in the final call to _client.query_points_groups the lookup_from argument is not passed, so the new parameter (and any caller‑supplied value) is effectively ignored. This also explains the Ruff “unused argument” warning for lookup_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_from usable and removes the unused‑parameter warning without altering other behavior. -->

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 27acfd0 and ac5dca8.

📒 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

Comment thread qdrant_client/async_qdrant_client.py
Comment thread qdrant_client/local/async_qdrant_local.py Outdated
Comment thread qdrant_client/local/order_by.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
qdrant_client/local/async_qdrant_local.py (1)

748-751: Past Optional NameError on metadata looks resolved; double‑check for any remaining Optional

The metadata parameter is now annotated as types.Payload | None = None, which avoids the previous Optional[...]/missing import problem noted in earlier CI failures and review comments. Given the current file contents, there’s no remaining Optional usage; if CI still reports a NameError for Optional, it’s worth grepping this file and the generator output to ensure there isn’t another Optional[...] 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 safe

The updated annotations (types.Filter | None, types.SearchParams | None, offset: int | None, with_payload / with_vectors unions, 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 to LocalCollection. The fact that search_params isn’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_points and query_points_groups signatures match remote API and use new unions correctly

All 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 optional with_lookup collections is unchanged and still guards lookups correctly. As with search, search_params remains unused in local mode for compatibility, which is expected.

Also applies to: 442-497


724-746: Collection update/create/recreate and _collection_path now handle in‑memory mode explicitly

update_collection’s new optional sparse_vectors_config and metadata types (Mapping[str, types.SparseVectorParams] | None, types.Payload | None) align with the server API and are guarded by is not None checks before mutating the collection config.

Changing _collection_path to return str | None and guarding its uses (if collection_path is not None) in delete_collection, create_collection, and recreate_collection avoids 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 unimplemented

The new optional types (field_schema/field_type: types.PayloadSchemaType | None, snapshot methods returning types.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 raise NotImplementedError, 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 unions

The updated annotations for query_filter, search_params, offset, with_payload, with_vectors, score_threshold, and using (X | None style) are in line with the HTTP and sync local APIs. The async wrappers still delegate straight to LocalCollection.search/search_matrix_*, so runtime behavior doesn’t change. As in the sync variant, search_params is 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_path handle in‑memory mode correctly in async variant

The optional sparse_vectors_config and metadata types in update_collection now match the sync version, with safe is not None checks before mutating. _collection_path returning str | None and guarded uses in delete_collection / create_collection / recreate_collection ensure 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 unimplemented

The new optional fields (field_schema/field_type as types.PayloadSchemaType | None, snapshot creators returning types.SnapshotDescription | None, shard creation args as optional ints/list) bring AsyncQdrantLocal in line with other async client surfaces. Since these methods only emit warnings or raise NotImplementedError, the changes are strictly to the type surface. field_schema/field_type being 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

📥 Commits

Reviewing files that changed from the base of the PR and between ac5dca8 and deb986a.

📒 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_file annotation look correct

Using Union alongside PEP 604 unions is fine in 3.10+ and still required for the large Union[...] in query_points_groups. The explicit self._flock_file: TextIOWrapper | None matches the actual usage (open() + portalocker.unlock / .close() guarded by is not None and .closed) and improves static checking without changing behavior.

Also applies to: 64-66


231-237: Query resolution helpers’ typing changes preserve invariants

Allowing query: types.Query | None, using: str | None, and lookup_from: types.LookupLocation | None, plus the broader prefetch: Sequence[types.Prefetch] | types.Prefetch | None, reflects actual usage patterns. Call sites never pass query=None into _resolve_query_input (they guard with if query is not None or early-return in _resolve_prefetch_input), so the internal deepcopy(query) and isinstance chain remain safe. The prefetch normalization still produces a clean list[types.Prefetch] and keeps None entries filtered out.

Also applies to: 262-287, 334-359


499-529: Scroll / count / facet typing updates align with backend expectations

Switching to scroll_filter: types.Filter | None, order_by: types.OrderBy | None, offset: types.PointId | None, and returning tuple[list[types.Record], types.PointId | None] reflects the actual shapes returned by LocalCollection.scroll. Likewise, count_filter: types.Filter | None and facet_filter: types.Filter | None match 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 sound

The conversion of update_filter to types.Filter | None, along with with_payload / with_vectors unions and an optional key: str | None in set_payload, is consistent with the HTTP models and other client surfaces. All these values are simply forwarded to LocalCollection, 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 with LocalCollection.upsert

Allowing _upload_points to accept Iterable[types.PointStruct | types.Record] matches how records are represented in the HTTP models, and the comprehension uses only id, vector, and payload attributes that both types expose. The upload_collection changes (vectors unions, payload/ids optional) are purely type-level; the logic converting dicts of np.ndarray to lists of plain Python types and zipping ids, vectors, and payload is unchanged and remains correct.

qdrant_client/local/async_qdrant_local.py (7)

20-21: Imports and _flock_file typing in async local client are consistent

Keeping Union in the imports is necessary for the large Union[...] used in e.g. query_points_groups, and works fine in 3.10+. The _flock_file: TextIOWrapper | None annotation mirrors the sync version and matches how the lock file is opened, locked, unlocked, and closed in __init__, _load, and close, improving type safety without changing behavior.

Also applies to: 49-67


220-227: Query and prefetch resolution helpers match sync semantics with updated typing

Allowing query: types.Query | None, using: str | None, and lookup_from: types.LookupLocation | None in _resolve_query_input, plus Sequence[types.Prefetch] | types.Prefetch | None in _resolve_prefetches_input, is consistent with the sync implementation and HTTP models. Callers never pass query=None into _resolve_query_input, and prefetch handling still flattens nested prefetches and filters out None entries. The changes here are type-only and keep the behavior identical.

Also applies to: 249-268, 312-331


347-381: query_points and query_batch_points async interfaces line up with sync/local and HTTP

The query_points signature now uses PEP 604 unions for query, using, prefetch, query_filter, search_params, offset, with_payload, with_vectors, score_threshold, and lookup_from, matching both AsyncQdrantBase and the sync QdrantLocal. The logic around _resolve_query_input and ignore_mentioned_ids_filter is unchanged, and offset or 0 still correctly defaults to 0 without altering existing semantics. query_batch_points just forwards fields from types.QueryRequest, so the type changes above are the key surface and they look consistent.

Also applies to: 382-401


402-457: query_points_groups async typing matches the sync method and HTTP models

The union for query and the new PEP 604 unions on using, prefetch, query_filter, search_params, with_payload, with_vectors, score_threshold, with_lookup, and lookup_from mirror the sync implementation and the higher-level client APIs. Resolution of with_lookup into with_lookup_collection remains 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 returned tuple[list[types.Record], types.PointId | None] now use the union syntax consistent with the sync version. count_filter and facet_filter likewise use types.Filter | None. All these values continue to be forwarded directly into LocalCollection, 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 correctly

The updated update_filter: types.Filter | None, with_payload / with_vectors unions, and key: str | None in set_payload mirror the sync local API and remote async clients. Methods still delegate straight to LocalCollection, and _default_update_result remains 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 typing

Allowing _upload_points to take Iterable[types.PointStruct | types.Record] and widening upload_collection’s vectors/payload/ids/update_filter types makes the async local surface match the sync local one. The conversion of dict-of-np.ndarray inputs 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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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: Convert Union to PEP 604 union syntax (|).

This method still uses the old Union syntax, but Union was removed from the imports at line 3. This causes the NameError reported 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: Convert Union to PEP 604 union syntax (|).

This method's return type still uses the old Union syntax, but Union was removed from the imports at line 3. This causes the NameError reported 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: Optional is not imported but used here.

The pipeline failure indicates that Optional is used on lines 2465-2466 but is not imported. Either import Optional from typing or convert to the X | None syntax 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: Optional is not imported but used here.

The pipeline failure indicates that Optional is used on lines 2628-2629 but is not imported. Either import Optional from typing or convert to the X | None syntax 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: Wire lookup_from through to the underlying client in query_points_groups

lookup_from is exposed in the AsyncQdrantClient.query_points_groups signature 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 ARG002

The parameters flagged by Ruff (search_params in search, query_points, query_points_groups, various **kwargs, and field_schema / field_type in create_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: ARG002 directive.

Also applies to: 357-357, 424-424, 470-470, 766-766, 830-831


223-314: Internal query/prefetch helpers: optional query typing vs. runtime expectations

_resolve_query_input is now typed as accepting query: types.Query | None, but the body assumes a non-None query (e.g., unguarded deepcopy(query) and isinstance checks); current internal call sites always pass a non-None query, so behavior is correct, but the annotation slightly over-promises. Either narrowing the type back to types.Query or adding a fast-path for query 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 annotations
qdrant_client/local/qdrant_local.py (1)

64-65: Local client typing updates look consistent; unused params can stay for API parity

The migration to T | None and widened unions for filters/configs/metadata across QdrantLocal (e.g., query_points, query_points_groups, scroll, update_collection, create_collection, upload_collection, and create_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 some kwargs) 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

📥 Commits

Reviewing files that changed from the base of the PR and between deb986a and 1a75c21.

⛔ Files ignored due to path filters (1)
  • poetry.lock is 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 consistent

Switching to TextIOWrapper | None for _flock_file and trimming typing imports 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 typing

The updated annotations for search, search_matrix_offsets, and search_matrix_pairs (e.g., types.Filter | None, str | None, enriched with_payload/with_vectors unions, and optional score_threshold) align with the rest of the client API and keep behavior unchanged by simply forwarding these parameters to the underlying LocalCollection. Looks good.

Also applies to: 195-207, 209-221


461-481: scroll annotation updates match underlying behavior

The new typing for scroll (scroll_filter: types.Filter | None, order_by: types.OrderBy | None, offset: types.PointId | None, and the return type tuple[list[types.Record], types.PointId | None]) accurately describes existing behavior and mirrors the sync local client; no functional change introduced.


482-503: count and facet filter annotations modernized correctly

Using types.Filter | None for count_filter and facet_filter brings 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_vectors optional update_filter typing is appropriate

Annotating update_filter as types.Filter | None in both upsert and update_vectors matches how the value is passed through to collection.upsert / collection.update_vectors and keeps the API surface consistent with other filter-taking methods.


537-547: Payload/vector union typings on retrieve and set_payload

The richer unions on with_payload / with_vectors (bool | Sequence[str] | types.PayloadSelector) and the optional key: str | None for set_payload match 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] | None and metadata: types.Payload | None in update_collection, create_collection, and recreate_collection correctly reflect that these fields are optional and are already guarded with is not None checks or safe deepcopy usage.
  • _collection_path’s return type str | None matches the actual behavior and the synchronous QdrantLocal implementation, and all call sites already handle None defensively (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_points now explicitly type update_filter as types.Filter | None and _upload_points’s points as Iterable[types.PointStruct | types.Record], which matches how both structs are used (point.id, point.vector, point.payload).
  • upload_collection’s vectors/payload/ids annotations (dict[str, types.NumpyArray] | types.NumpyArray | Iterable[types.VectorStruct], Iterable[dict[Any, Any]] | None, Iterable[types.PointId] | None) accurately describe the existing branching logic and zip usage.
    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” semantics

The updated optional typings in create_payload_index (field_schema/field_type), snapshot-related methods (create_snapshot, create_shard_snapshot returning types.SnapshotDescription | None), and create_shard_key (shards_number/replication_factor/placement as optional) align with the remote client’s surface, while all of these methods still immediately raise NotImplementedError (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 TypeAlias import is now correctly sourced directly from typing for 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 explicit TypeAlias annotations. 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. Union is retained for complex union types used in method signatures (e.g., query parameter), while the simpler nullable types use the X | None syntax.

qdrant_client/client_base.py (1)

1-4: Base client PEP 604 typing update is consistent with implementations

The switch to T | None across the base interface (filters, offsets, lookup_from, snapshot methods, shard‑key helpers, and migrate/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 implementations

The move to PEP 604 unions in AsyncQdrantBase (nullable filters, offsets, lookup_from, vectors_config, snapshot/shard methods, migrate/create_shard_key, etc.) is consistent with AsyncQdrantClient and AsyncQdrantRemote, and keeps the async interface in sync with the sync QdrantBase.

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

Comment thread qdrant_client/async_qdrant_client.py
Comment thread qdrant_client/async_qdrant_remote.py Outdated
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

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_args

Note: 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.

Suggested change
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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: Forward lookup_from to _client.query_points_groups to avoid silently ignoring it

In query_points_groups (Lines 421‑582), the new/annotated parameter lookup_from: types.LookupLocation | None = None is:

  • 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‑supplied lookup_from is 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: Convert shard_key_selector parameter using convert_shard_key_selector before passing to REST models

PointIdsList and FilterSelector REST models expect shard_key: Optional["ShardKeySelector"] (REST type), but convert_points_selector passes the gRPC shard_key_selector parameter directly without conversion. This creates a type mismatch with REST models.

For consistency with convert_query_points (lines 1416–1422), which properly converts via cls.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

📥 Commits

Reviewing files that changed from the base of the PR and between 1a75c21 and baf2d0e.

📒 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 previous Optional[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 in ingest_dense_vector_data and fulfilling the Python 3.10+ requirement.

qdrant_client/hybrid/fusion.py (1)

7-11: PEP 604 union annotation looks correct and consistent

The ranking_constant_k: int | None = None annotation is valid for Python 3.10+, matches the project-wide Optional→PEP 604 migration, and does not affect runtime behavior of reciprocal_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 Union and Tuple from imports (line 6)
  • Changed Tuple[float, float, float, float] to tuple[float, float, float, float] (line 223)
  • Changed Union[str, int] to str | 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 to Optional[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 | None for the parameter and OrderValue | None for the return type), and the Optional and Union imports 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.Union removal is now safe

All remaining Union[...] annotations have been migrated to A | B syntax; there are no runtime references to Union, so dropping it from the imports is correct and fixes the earlier NameError risk.


639-645: Range handling annotations now match actual usage

Typing range_ as rest.RangeInterface | None and convert_datetime as datetime | date aligns 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 migration

The updated annotations for _convert_vector, convert_vector, convert_vector_output, the inner convert_vector helpers in convert_vector_struct/convert_vector_struct_output, and convert_named_vector_struct correctly describe the possible dense, multi‑dense, sparse, and document/image/object variants flowing through these paths. The use of grpc.* types in _convert_vector and 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_operations union parameter type looks good

The parameter type is now expressed as a PEP‑604 union over the supported gRPC cluster operation messages, matching the isinstance dispatch below and improving readability without changing behavior.


2648-2667: convert_filter’s helper now properly documents list-or-single input

Typing conditions as list[rest.Condition] | rest.Condition matches the existing normalization logic (if not isinstance(conditions, list): conditions = [conditions]). This is a clean, annotation‑only improvement.


4628-4639: RestToGrpc.convert_cluster_operations return union matches branch coverage

The return type is now an explicit union of the eight possible gRPC cluster operation messages, in line with the isinstance branches below. This makes the bidirectional cluster conversion API symmetrical with the GrpcToRest side.

qdrant_client/async_qdrant_remote.py (2)

47-62: Constructor and gRPC setup typings look consistent with runtime behavior

The migration to T | None in 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:

  • port and host are allowed to be None and are normalized later depending on url vs host, which the tests already exercise.
  • timeout remains an optional int, with _timeout falling back to DEFAULT_GRPC_TIMEOUT and being passed both to httpx and gRPC calls without changing control flow.
  • grpc_compression: Compression | None and 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 | None pattern with explicit assert is sound

The updated annotation result: models.QueryResponse | None = query_result.result followed by assert result is not None before returning is a good way to reflect the OpenAPI client's Optional[...] 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. Both PointVectors and StrictModeConfig are concrete Pydantic model classes in the REST models, and the type aliases in conversions/common_types.py simply 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_grace parameter 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 | None return 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 and close typing updates look consistent with the rest of the client surface

  • Import list (Line 13) and __init__ parameter annotations (Lines 85‑103) correctly reflect None defaults via T | None and use built‑in generics (dict[str, Any], etc.).
  • AsyncQdrantClient.close (Lines 158‑165) now takes grpc_grace: float | None = None and forwards it to self._client.close, matching the sync client’s close signature in qdrant_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 forwarded

For query_batch_points (Lines 209‑249) and query_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 _client methods, so the public async wrapper remains a thin, accurately typed layer.
  • Embedding / inference logic around query and prefetch remains unchanged.

No issues beyond typing modernization.


584-675: Matrix search helpers: type changes are coherent and correctly propagated

For search_matrix_pairs and search_matrix_offsets (Lines 584‑675):

  • query_filter, using, consistency, timeout, and shard_key_selector are 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 usage

In scroll, count, and facet (Lines 676‑833):

  • Filter, ordering, shard selection, and timeout parameters are upgraded to T | None where they can be omitted.
  • scroll’s return type tuple[list[types.Record], types.PointId | None] matches the documented “(list, optional offset)” behavior.
  • All newly annotated parameters are forwarded unchanged to the underlying _client methods.

No issues observed.


835-1410: Mutation APIs (upsert/update/delete/payload/batch) have consistent | None typing

Across upsert, update_vectors, delete_vectors, delete, set_payload, overwrite_payload, delete_payload, clear_payload, and batch_update_points (Lines 835‑1410):

  • ordering, shard_key_selector, update_filter, and optional key are correctly typed as ... | None while preserving existing defaults.
  • All of these arguments are forwarded to the corresponding _client methods.
  • 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 sound

For update_collection_aliases, update_collection, and delete_collection (Lines 1411‑1561):

  • timeout and 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_config in update_collection is unchanged; the updated typing does not alter that behavior.
  • All parameters are passed through to _client with the same names.

Looks correct and consistent with the rest of the API.


1563-1740: Collection creation/recreation: optional config typing matches behavior

In create_collection and recreate_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 of None.
  • Calls to _client.create_collection / _client.recreate_collection forward all these parameters by name, so runtime behavior is unchanged.
  • Deprecation warning for recreate_collection remains 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 aligned

For upload_points and upload_collection (Lines 1742‑1881):

  • method, shard_key_selector, and update_filter are now ... | None, reflecting their optional use.
  • vectors in upload_collection is now a union of Iterable[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: modernized ordering typing only

In create_payload_index and delete_payload_index (Lines 1883‑1958):

  • field_schema / field_type and ordering are 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 correct

For 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 | None or bool | None, which matches the documented “wait or not” semantics.
  • Optional parameters (api_key, checksum, priority) use ... | None and are consistently forwarded to _client.
  • Assertion guards on kwargs are preserved.

These changes improve type precision without altering behavior.


2225-2349: Shard key and cluster management methods, including remove_peer, are correctly updated

For create_shard_key, cluster_collection_update, collection_cluster_info, cluster_status, recover_current_peer, and remove_peer (Lines 2225‑2349):

  • Optional parameters like shards_number, replication_factor, placement, and timeout are now annotated with | None and are passed through appropriately.
  • remove_peer now uses force: bool | None = None and timeout: 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (11)
qdrant_client/local/local_collection.py (11)

283-303: Keep _resolve_query_vector_name signature, comment, and unions in sync

The expanded query_vector union (including SparseQueryVector, MultiQueryVector, etc.) matches the downstream isinstance branches, 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_vectors typing vs runtime behavior

The annotations now use bool | Sequence[str] | types.PayloadSelector, but:

  • _process_payload special-cases list rather than generic Sequence, so a tuple of fields will currently fall through and return the full payload, not a filtered view.
  • _get_vectors treats with_vectors as bool | Sequence[str] | None but call sites generally pass bool or list[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] to list at the top of _process_payload / _get_vectors.

This is purely a typing contract issue; runtime behavior is unchanged.


498-521: Use types.Filter consistently in _payload_and_non_deleted_mask

The parameter is annotated as models.Filter | None, while most call sites are typed as types.Filter | None. At runtime this is fine (the value is just passed through to calculate_payload_mask), but the mismatch is slightly confusing for type-checkers and readers.

Consider annotating this as types.Filter | None for consistency with callers.


533-554: Complex query_vector union in search could benefit from a shared alias

The search signature now mirrors _resolve_query_vector_name with 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 both search and _resolve_query_vector_name to reduce duplication.


701-807: Broaden prefetch typing in query_points / _merge_sources to match actual behavior

query_points now annotates prefetch: list[types.Prefetch] | None, but the implementation still handles both a single Prefetch and a list:

prefetches = prefetch if isinstance(prefetch, list) else [prefetch]

Similarly, set_prefetch_limit_iteratively accepts types.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 = None

No runtime bug here; just a type-level contract mismatch.


871-881: _query_collection default with_payload=False is unused but consistent

The default for with_payload is now False, but all internal callers pass an explicit value. This doesn’t change behavior and is consistent with _sample_randomly / search defaults.

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_groups typing is consistent; minor note on with_payload

The updated types (query as a broad union of input formats, with_payload: bool | Sequence[str] | types.PayloadSelector, and with_lookup_collection: "LocalCollection | None") line up with actual usage and grouping logic.

As in _process_payload, with_payload is annotated as Sequence[str] but only list is 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_input can still be None

_preprocess_recommend_input is annotated to return types.Filter as its last tuple element, but:

  • The input query_filter is types.Filter | None.
  • ignore_mentioned_ids_filter can return the original query_filter unchanged when mentioned_ids is empty.

So the returned query_filter can still be None. The current call sites (e.g. _construct_recommend_query, recommend, recommend_groups) pass it into APIs that accept types.Filter | None, so this is only a typing inconsistency.

Consider changing the return type to types.Filter | None (and similarly for _construct_recommend_query below) to better reflect actual behavior.


1384-1465: _construct_recommend_query filter return type is too narrow

Same concern as above: the return annotation uses types.Filter, but edited_query_filter can be None if no ids were mentioned and the original query_filter was None.

Since recommend passes edited_query_filter straight into search(query_filter=...), which allows None, updating the return annotation to types.Filter | None would better match reality and avoid confusing type-checkers.


1659-1762: _preprocess_target / _preprocess_discover: filter return type can be None

The new signatures and return types correctly capture vector/ContextPair variants, but:

  • _preprocess_discover is annotated to return types.Filter in its last position.
  • It calls ignore_mentioned_ids_filter, which can return None when no ids are mentioned and the input query_filter is None.

Callers like discover pass this into search, which accepts types.Filter | None, so this is only a typing mismatch. As with the recommend path, consider changing the return to types.Filter | None.


2806-2851: ignore_mentioned_ids_filter / _include_ids_in_filter return types can be None

Both helpers are annotated as returning types.Filter, but:

  • If mentioned_ids / ids is empty, they immediately return query_filter, which may be None.
  • Callers such as _preprocess_recommend_input, _construct_recommend_query, and _preprocess_discover then propagate this filter into methods that explicitly accept types.Filter | None.

To keep typing honest and avoid surprising mypy behavior, consider changing the return annotations to types.Filter | None (and updating the dependent helper signatures that currently promise a non-optional types.Filter as discussed above).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between baf2d0e and 05380b1.

📒 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] to T | None and 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 Optional import 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 | None instead of Optional[T]
  • Union types using A | B syntax

The 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 behavior

Switching location to str | None aligns with actual usage (self.persistent = location is not None and conditional CollectionPersistence). No behavior change introduced here.


1159-1167: facet_filter now uses types.Filter | None — consistent with other entry points

Using types.Filter | None here and then delegating to _payload_and_non_deleted_mask keeps the filtering path aligned with search/scroll. No behavior change introduced.

Looks good.


1209-1214: retrieve typing for with_payload / with_vectors matches helpers

The updated types (bool | Sequence[str] | types.PayloadSelector for with_payload, and bool | Sequence[str] for with_vectors) now match _get_payload and _get_vectors. This clarifies the API without changing behavior.

All good here.


1468-1521: recommend / recommend_groups new type hints align with internal machinery

The broadened unions on positive/negative, query_filter: types.Filter | None, using: str | None, and the strategy defaults all match how _construct_recommend_query and _preprocess_recommend_input operate. 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 | None and using: str | None propagate cleanly through to _search_distance_matrix, then into self._sample_randomly and self.search. The contract remains unchanged; this is just modernized typing.

No issues spotted.


1796-1857: discover typing matches underlying preprocessing and search

The updated optional parameters (target, context, query_filter, using, lookup options, and score_threshold) reflect how _preprocess_discover and search are used. The intermediate query_vector annotation (DenseQueryVector | SparseQueryVector | MultiQueryVector) is accurate and helps static tools.

Looks correct overall; no behavior change.


1867-1952: scroll / _scroll_by_id / _scroll_by_value filter & selector types are consistent

  • scroll_filter: types.Filter | None and order_by: types.OrderBy | None align with how calculate_payload_mask and OrderBy are used.
  • offset: types.PointId | None for _scroll_by_id accurately models both string and int ids.
  • with_payload / with_vectors annotations now match _get_payload / _get_vectors.

No functional changes; typing is in line with actual logic.


2019-2052: _sample_randomly typing matches usage

The updated query_filter: types.Filter | None, with_payload, and with_vectors types 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_mmr now explicitly annotates query_vector as (list[float] | SparseVector | list[list[float]]), which matches how _mmr consumes it.
  • query_filter: types.Filter | None and offset: int | None are consistent with the surrounding search APIs.
  • _mmr's query_vector annotation 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_filter typing and vector handling remain correct

  • _upsert_point and upsert now accept update_filter: types.Filter | None, which matches how check_filter is used.
  • The validation of sparse vectors and the check against self._all_vectors_keys are unchanged.
  • The batch path still builds vector dicts per-id as before.

This is all consistent with previous behavior (and with the past learning about OverwritePayloadOperation using SetPayload semantics in batch_update_points later in the file).


2507-2562: _update_named_vectors / update_vectors vector type hints improved

The new signature:

self, idx: int, vectors: dict[str, list[float] | SparseVector | list[list[float]]]

matches how _update_named_vectors branches between dense, sparse, and multivector updates. update_vectors normalizes vector_struct (list vs dict) as before.

No functional changes; the annotations now better describe the accepted shapes.


2564-2627: Selector unions for delete_vectors / _selector_to_ids / delete look correct

Using a shared selector union:

models.Filter
| list[models.ExtendedPointId]
| models.FilterSelector
| models.PointIdsList

across delete_vectors, _selector_to_ids, and delete improves clarity and keeps the logic centralized in _selector_to_ids. This matches how batch_update_points constructs selectors.

No behavior change here.


2638-2711: Payload operations: selector and key typings match actual behavior

  • set_payload, overwrite_payload, delete_payload, and clear_payload all use the same selector union, which is good.
  • key: str | None plus keys: list[JsonPathItem] | None = parse_json_path(key) if key is not None else None accurately reflects the JSONPath-based update behavior.

Everything here is consistent with previous semantics.


2865-2890: Iterative set_prefetch_limit_iteratively looks correct and avoids recursion

The new stack-based implementation:

  • Correctly handles both a single types.Prefetch and nested lists of Prefetch.
  • Mirrors the recursive behavior (set limit on each Prefetch, then walk its prefetch field), 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.

@joein joein requested a review from tbung December 2, 2025 07:12

@tbung tbung left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think you missed some, at least

from typing import Sequence, Union

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.

Comment thread pyproject.toml Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I guess we can drop this numpy version specifier.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

adjusted 👍

Comment thread tests/congruence_tests/test_query.py Outdated
@@ -1,4 +1,4 @@
from typing import Tuple, Callable, Any, Union
from typing import Tuple, Callable, Any

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

wondering how I missed all that...
thanks

@joein

joein commented Dec 4, 2025

Copy link
Copy Markdown
Member Author

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.

Yeah, but it might be trickier, probably sometime later..

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_from in query_points_groups is accepted but never used

query_points_groups exposes lookup_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_points and 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_from in query_points_groups is accepted but never used

query_points_groups exposes a lookup_from parameter and documents it, but the value is not forwarded to self._client.query_points_groups, so any caller-provided lookup_from is 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 **kwargs in autogenerated methods are benign

Ruff’s ARG002 on unused kwargs in methods like close, scroll, delete_collection, recover_snapshot, recover_shard_snapshot, and remove_peer stems from the common AsyncQdrantBase interface—callers assert len(kwargs) == 0 in 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 mismatch

The shift to explicit ... | None in 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 that create_collection/recreate_collection require a non‑optional vectors_config, while AsyncQdrantClient and AsyncQdrantRemote accept vectors_config | None; if you rely on strict type checking, consider adding | None here 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; consider vectors_config | None for parity

The migration to | None for 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 with AsyncQdrantBase, create_collection/recreate_collection here still require non‑nullable vectors_config, whereas higher‑level clients accept vectors_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

📥 Commits

Reviewing files that changed from the base of the PR and between 05380b1 and 64da41d.

📒 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 from Optional[T]/Union[A, B] to T | None/A | B are 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_grace and kwargs as 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 | None syntax, 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 Tuple and Union type aliases have been removed, addressing the past review comment about using built-in tuple instead. 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] to models.QueryResponse | str, using the modern union syntax.


923-923: LGTM! Tuple type properly updated.

The return type now uses the built-in tuple instead of the deprecated Tuple type alias, consistent with Python 3.10+ best practices.

qdrant_client/async_qdrant_remote.py (2)

47-173: Constructor and connection setup changes look consistent

The widened | None annotations for URL/host/ports, auth token provider, pool size, and the gRPC client pools align with existing runtime logic (including _https/_scheme handling, timeout ceiling, and channel pools) without changing behavior. The close implementation correctly accepts the new grpc_grace: float | None and preserves prior shutdown semantics.

Also applies to: 201-233


364-513: Optional .result handling and updated return types are sound

The new T | None annotations for REST .result values (e.g., query/query_batch, scroll, count/facet, collection update/create/delete, payload index APIs) combined with explicit assert result is not None where a None would be unexpected, and | None return types where None is 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 and close coroutine updated safely

The async client’s __init__ now cleanly models nullable location/url/host/timeout/etc. and the broader auth token provider type without changing control flow, and async 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 for lookup_from in groups

The expanded union‑typed parameters for query_batch_points, query_points, query_points_groups, search‑matrix methods, scroll, count, and facet align with the async base/remote signatures, and all non‑derived arguments (filters, consistency, shard selectors, timeouts) are forwarded correctly to _client. The only exception is lookup_from in query_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 consistent

The updated annotations for ordering, shard_key_selector, update_filter, and related flags in upsert, update_vectors, delete_vectors, set_payload, overwrite_payload, delete_payload, clear_payload, and batch_update_points match 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 configs

For alias operations and collection lifecycle (update_collection_aliases, get_*, update_collection, delete_collection, create_collection, recreate_collection), the introduction of | None on optimizer/collection/vector/HNSW/quantization/sparse/strict/metadata/timeouts and the corresponding forwarding logic to _client accurately mirror the remote API and prior behavior. The deprecation warning on recreate_collection remains intact.


1738-1877: Bulk upload helpers remain behaviorally unchanged under new typing

The synchronous upload_points and upload_collection wrappers now type method, shard_key_selector, update_filter, vectors, payload, and ids with | None, while the lazy embedding and dispatch to _client.upload_* are unchanged. The inference check and chain helper 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_index and delete_payload_index now accept field_schema: PayloadSchemaType | None, field_type: PayloadSchemaType | None, and ordering: 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 params

The snapshot CRUD and recovery methods (create_snapshot, delete_snapshot, create_full_snapshot, delete_full_snapshot, recover_snapshot, and their shard equivalents) have been updated to SnapshotDescription | None / bool | None and to accept optional api_key, checksum, and priority, which aligns with the async remote implementations returning possibly‑None .result values. Forwarding of all parameters, including priority, is correct.


2221-2345: Shard key and cluster administration APIs match new nullable config surface

The create_shard_key, delete_shard_key, cluster_collection_update, collection_cluster_info, cluster_status, recover_current_peer, and remove_peer methods now expose the same | None timeouts and shard parameters as the async remote, and simply delegate to _client without altering behavior. The earlier issue around remove_peer’s force/timeout typing has been resolved with the new bool | None / int | None hints.

qdrant_client/qdrant_client.py (1)

82-103: Init options and 3.10+ typing look consistent

The __init__ signature and _init_options capture still line up with the documented semantics (mutually exclusive location/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.

@joein joein requested a review from tbung December 4, 2025 05:25
@joein joein merged commit a8beff7 into dev Dec 5, 2025
12 of 16 checks passed
joein added a commit that referenced this pull request Dec 12, 2025
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants