Skip to content

Commit a8beff7

Browse files
joeingenerall
andauthored
Drop python3.9 (#1110)
* 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]>
1 parent 20cc45f commit a8beff7

File tree

84 files changed

+2148
-2779
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2148
-2779
lines changed

.github/workflows/integration-tests-macos.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
strategy:
1414
matrix:
1515
python-version:
16-
- '3.9.x'
1716
- '3.10.x'
1817
- '3.11.x'
1918
- '3.12.x'

.github/workflows/integration-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
strategy:
1515
matrix:
1616
python-version:
17-
- '3.9.x'
1817
- '3.10.x'
1918
- '3.11.x'
2019
- '3.12.x'

.github/workflows/python-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Set up Python
2727
uses: actions/setup-python@v2
2828
with:
29-
python-version: '3.9.x'
29+
python-version: '3.10.x'
3030
- name: Install dependencies
3131
run: |
3232
python -m pip install poetry

.github/workflows/type-checkers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: true
1010
matrix:
11-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
11+
python-version: ["3.10", "3.11", "3.12", "3.13"]
1212
os: [ubuntu-latest]
1313

1414
name: Python ${{ matrix.python-version }} test

poetry.lock

Lines changed: 287 additions & 709 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ repository = "https://github.com/qdrant/qdrant-client"
1313
keywords = ["vector", "search", "neural", "matching", "client"]
1414

1515
[tool.poetry.dependencies]
16-
python = ">=3.9"
16+
python = ">=3.10"
1717
httpx = { version = ">=0.20.0", extras = ["http2"] }
1818
numpy = [
19-
{ version = ">=1.21,<2.1.0", python = "<3.10" },
2019
{ version = ">=1.21,<2.3.0", python = ">=3.10,<3.11" },
2120
{ version = ">=1.21", python = ">=3.11,<3.12" },
2221
{ version = ">=1.26", python = ">=3.12,<3.13" },

qdrant_client/async_client_base.py

Lines changed: 73 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#
1010
# ****** WARNING: THIS FILE IS AUTOGENERATED ******
1111

12-
from typing import Any, Iterable, Mapping, Optional, Sequence, Union
12+
from typing import Any, Iterable, Mapping, Sequence
1313
from qdrant_client.conversions import common_types as types
1414

1515

@@ -20,21 +20,21 @@ def __init__(self, **kwargs: Any):
2020
async def search_matrix_offsets(
2121
self,
2222
collection_name: str,
23-
query_filter: Optional[types.Filter] = None,
23+
query_filter: types.Filter | None = None,
2424
limit: int = 3,
2525
sample: int = 10,
26-
using: Optional[str] = None,
26+
using: str | None = None,
2727
**kwargs: Any,
2828
) -> types.SearchMatrixOffsetsResponse:
2929
raise NotImplementedError()
3030

3131
async def search_matrix_pairs(
3232
self,
3333
collection_name: str,
34-
query_filter: Optional[types.Filter] = None,
34+
query_filter: types.Filter | None = None,
3535
limit: int = 3,
3636
sample: int = 10,
37-
using: Optional[str] = None,
37+
using: str | None = None,
3838
**kwargs: Any,
3939
) -> types.SearchMatrixPairsResponse:
4040
raise NotImplementedError()
@@ -47,28 +47,26 @@ async def query_batch_points(
4747
async def query_points(
4848
self,
4949
collection_name: str,
50-
query: Union[
51-
types.PointId,
52-
list[float],
53-
list[list[float]],
54-
types.SparseVector,
55-
types.Query,
56-
types.NumpyArray,
57-
types.Document,
58-
types.Image,
59-
types.InferenceObject,
60-
None,
61-
] = None,
62-
using: Optional[str] = None,
63-
prefetch: Union[types.Prefetch, list[types.Prefetch], None] = None,
64-
query_filter: Optional[types.Filter] = None,
65-
search_params: Optional[types.SearchParams] = None,
50+
query: types.PointId
51+
| list[float]
52+
| list[list[float]]
53+
| types.SparseVector
54+
| types.Query
55+
| types.NumpyArray
56+
| types.Document
57+
| types.Image
58+
| types.InferenceObject
59+
| None = None,
60+
using: str | None = None,
61+
prefetch: types.Prefetch | list[types.Prefetch] | None = None,
62+
query_filter: types.Filter | None = None,
63+
search_params: types.SearchParams | None = None,
6664
limit: int = 10,
67-
offset: Optional[int] = None,
68-
with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True,
69-
with_vectors: Union[bool, Sequence[str]] = False,
70-
score_threshold: Optional[float] = None,
71-
lookup_from: Optional[types.LookupLocation] = None,
65+
offset: int | None = None,
66+
with_payload: bool | Sequence[str] | types.PayloadSelector = True,
67+
with_vectors: bool | Sequence[str] = False,
68+
score_threshold: float | None = None,
69+
lookup_from: types.LookupLocation | None = None,
7270
**kwargs: Any,
7371
) -> types.QueryResponse:
7472
raise NotImplementedError()
@@ -77,50 +75,48 @@ async def query_points_groups(
7775
self,
7876
collection_name: str,
7977
group_by: str,
80-
query: Union[
81-
types.PointId,
82-
list[float],
83-
list[list[float]],
84-
types.SparseVector,
85-
types.Query,
86-
types.NumpyArray,
87-
types.Document,
88-
types.Image,
89-
types.InferenceObject,
90-
None,
91-
] = None,
92-
using: Optional[str] = None,
93-
prefetch: Union[types.Prefetch, list[types.Prefetch], None] = None,
94-
query_filter: Optional[types.Filter] = None,
95-
search_params: Optional[types.SearchParams] = None,
78+
query: types.PointId
79+
| list[float]
80+
| list[list[float]]
81+
| types.SparseVector
82+
| types.Query
83+
| types.NumpyArray
84+
| types.Document
85+
| types.Image
86+
| types.InferenceObject
87+
| None = None,
88+
using: str | None = None,
89+
prefetch: types.Prefetch | list[types.Prefetch] | None = None,
90+
query_filter: types.Filter | None = None,
91+
search_params: types.SearchParams | None = None,
9692
limit: int = 10,
9793
group_size: int = 3,
98-
with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True,
99-
with_vectors: Union[bool, Sequence[str]] = False,
100-
score_threshold: Optional[float] = None,
101-
with_lookup: Optional[types.WithLookupInterface] = None,
102-
lookup_from: Optional[types.LookupLocation] = None,
94+
with_payload: bool | Sequence[str] | types.PayloadSelector = True,
95+
with_vectors: bool | Sequence[str] = False,
96+
score_threshold: float | None = None,
97+
with_lookup: types.WithLookupInterface | None = None,
98+
lookup_from: types.LookupLocation | None = None,
10399
**kwargs: Any,
104100
) -> types.GroupsResult:
105101
raise NotImplementedError()
106102

107103
async def scroll(
108104
self,
109105
collection_name: str,
110-
scroll_filter: Optional[types.Filter] = None,
106+
scroll_filter: types.Filter | None = None,
111107
limit: int = 10,
112-
order_by: Optional[types.OrderBy] = None,
113-
offset: Optional[types.PointId] = None,
114-
with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True,
115-
with_vectors: Union[bool, Sequence[str]] = False,
108+
order_by: types.OrderBy | None = None,
109+
offset: types.PointId | None = None,
110+
with_payload: bool | Sequence[str] | types.PayloadSelector = True,
111+
with_vectors: bool | Sequence[str] = False,
116112
**kwargs: Any,
117-
) -> tuple[list[types.Record], Optional[types.PointId]]:
113+
) -> tuple[list[types.Record], types.PointId | None]:
118114
raise NotImplementedError()
119115

120116
async def count(
121117
self,
122118
collection_name: str,
123-
count_filter: Optional[types.Filter] = None,
119+
count_filter: types.Filter | None = None,
124120
exact: bool = True,
125121
**kwargs: Any,
126122
) -> types.CountResult:
@@ -130,7 +126,7 @@ async def facet(
130126
self,
131127
collection_name: str,
132128
key: str,
133-
facet_filter: Optional[types.Filter] = None,
129+
facet_filter: types.Filter | None = None,
134130
limit: int = 10,
135131
exact: bool = False,
136132
**kwargs: Any,
@@ -160,8 +156,8 @@ async def retrieve(
160156
self,
161157
collection_name: str,
162158
ids: Sequence[types.PointId],
163-
with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True,
164-
with_vectors: Union[bool, Sequence[str]] = False,
159+
with_payload: bool | Sequence[str] | types.PayloadSelector = True,
160+
with_vectors: bool | Sequence[str] = False,
165161
**kwargs: Any,
166162
) -> list[types.Record]:
167163
raise NotImplementedError()
@@ -176,7 +172,7 @@ async def set_payload(
176172
collection_name: str,
177173
payload: types.Payload,
178174
points: types.PointsSelector,
179-
key: Optional[str] = None,
175+
key: str | None = None,
180176
**kwargs: Any,
181177
) -> types.UpdateResult:
182178
raise NotImplementedError()
@@ -243,15 +239,15 @@ async def delete_collection(self, collection_name: str, **kwargs: Any) -> bool:
243239
async def create_collection(
244240
self,
245241
collection_name: str,
246-
vectors_config: Union[types.VectorParams, Mapping[str, types.VectorParams]],
242+
vectors_config: types.VectorParams | Mapping[str, types.VectorParams],
247243
**kwargs: Any,
248244
) -> bool:
249245
raise NotImplementedError()
250246

251247
async def recreate_collection(
252248
self,
253249
collection_name: str,
254-
vectors_config: Union[types.VectorParams, Mapping[str, types.VectorParams]],
250+
vectors_config: types.VectorParams | Mapping[str, types.VectorParams],
255251
**kwargs: Any,
256252
) -> bool:
257253
raise NotImplementedError()
@@ -264,11 +260,9 @@ def upload_points(
264260
def upload_collection(
265261
self,
266262
collection_name: str,
267-
vectors: Union[
268-
dict[str, types.NumpyArray], types.NumpyArray, Iterable[types.VectorStruct]
269-
],
270-
payload: Optional[Iterable[dict[Any, Any]]] = None,
271-
ids: Optional[Iterable[types.PointId]] = None,
263+
vectors: dict[str, types.NumpyArray] | types.NumpyArray | Iterable[types.VectorStruct],
264+
payload: Iterable[dict[Any, Any]] | None = None,
265+
ids: Iterable[types.PointId] | None = None,
272266
**kwargs: Any,
273267
) -> None:
274268
raise NotImplementedError()
@@ -277,8 +271,8 @@ async def create_payload_index(
277271
self,
278272
collection_name: str,
279273
field_name: str,
280-
field_schema: Optional[types.PayloadSchemaType] = None,
281-
field_type: Optional[types.PayloadSchemaType] = None,
274+
field_schema: types.PayloadSchemaType | None = None,
275+
field_type: types.PayloadSchemaType | None = None,
282276
**kwargs: Any,
283277
) -> types.UpdateResult:
284278
raise NotImplementedError()
@@ -295,26 +289,26 @@ async def list_snapshots(
295289

296290
async def create_snapshot(
297291
self, collection_name: str, **kwargs: Any
298-
) -> Optional[types.SnapshotDescription]:
292+
) -> types.SnapshotDescription | None:
299293
raise NotImplementedError()
300294

301295
async def delete_snapshot(
302296
self, collection_name: str, snapshot_name: str, **kwargs: Any
303-
) -> Optional[bool]:
297+
) -> bool | None:
304298
raise NotImplementedError()
305299

306300
async def list_full_snapshots(self, **kwargs: Any) -> list[types.SnapshotDescription]:
307301
raise NotImplementedError()
308302

309-
async def create_full_snapshot(self, **kwargs: Any) -> Optional[types.SnapshotDescription]:
303+
async def create_full_snapshot(self, **kwargs: Any) -> types.SnapshotDescription | None:
310304
raise NotImplementedError()
311305

312-
async def delete_full_snapshot(self, snapshot_name: str, **kwargs: Any) -> Optional[bool]:
306+
async def delete_full_snapshot(self, snapshot_name: str, **kwargs: Any) -> bool | None:
313307
raise NotImplementedError()
314308

315309
async def recover_snapshot(
316310
self, collection_name: str, location: str, **kwargs: Any
317-
) -> Optional[bool]:
311+
) -> bool | None:
318312
raise NotImplementedError()
319313

320314
async def list_shard_snapshots(
@@ -324,17 +318,17 @@ async def list_shard_snapshots(
324318

325319
async def create_shard_snapshot(
326320
self, collection_name: str, shard_id: int, **kwargs: Any
327-
) -> Optional[types.SnapshotDescription]:
321+
) -> types.SnapshotDescription | None:
328322
raise NotImplementedError()
329323

330324
async def delete_shard_snapshot(
331325
self, collection_name: str, shard_id: int, snapshot_name: str, **kwargs: Any
332-
) -> Optional[bool]:
326+
) -> bool | None:
333327
raise NotImplementedError()
334328

335329
async def recover_shard_snapshot(
336330
self, collection_name: str, shard_id: int, location: str, **kwargs: Any
337-
) -> Optional[bool]:
331+
) -> bool | None:
338332
raise NotImplementedError()
339333

340334
async def close(self, **kwargs: Any) -> None:
@@ -343,7 +337,7 @@ async def close(self, **kwargs: Any) -> None:
343337
def migrate(
344338
self,
345339
dest_client: "AsyncQdrantBase",
346-
collection_names: Optional[list[str]] = None,
340+
collection_names: list[str] | None = None,
347341
batch_size: int = 100,
348342
recreate_on_collision: bool = False,
349343
) -> None:
@@ -353,9 +347,9 @@ async def create_shard_key(
353347
self,
354348
collection_name: str,
355349
shard_key: types.ShardKey,
356-
shards_number: Optional[int] = None,
357-
replication_factor: Optional[int] = None,
358-
placement: Optional[list[int]] = None,
350+
shards_number: int | None = None,
351+
replication_factor: int | None = None,
352+
placement: list[int] | None = None,
359353
**kwargs: Any,
360354
) -> bool:
361355
raise NotImplementedError()

0 commit comments

Comments
 (0)