Fix docs typo - #1457
Open
kaseraaryan5-star wants to merge 478 commits into
Open
Fix docs typo#1457kaseraaryan5-star wants to merge 478 commits into
kaseraaryan5-star wants to merge 478 commits into
Conversation
* Removed invalid await from grpc async call * fix: fix generation of grpc async create shard key, add tests --------- Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
* change np.NINF to -np.inf * Update qdrant_client/local/local_collection.py --------- Co-authored-by: George <panchuk.george@outlook.com>
* update rest client * update grpc client with grpcio 1.65.4 * update grpc client with grpcio==1.49.1 * generate grpc client with grpcio==1.48.2 * generate grpc client with grpcio==1.66.1 and mypy-protobuf extension * add mypy-protobuf to pyproject * relax version for grpcio, but keep grpcio-tools at 1.48.2 * improve generation script * fix bash script comment Co-authored-by: George <george.panchuk@qdrant.tech> * use old grpcio to generate client * rollbakc mypy-protobuf * regenerate with distance matrix * new: update clients (qdrant#774) * new: update clients * rollback grpcio version * feature: Facets (qdrant#759) * facet in local_collection.py * replace usages of calculate_payload_mask * - qdrant remote - qdrant base - qdrant client - conversions * congruence tests + local mode fixes * generate async client * add type stubs and misc fixes * fix mypy in Python 3.8 * generate async client * review remarks * gen async client * update for bool facets * Feature: Distance Matrix API (qdrant#769) * add remote impls * add client impl * regen async client * start local * regen async * local mode * start congruence * Fix local mode * regen async of course * test filtering * fix min samples count * simplify comparaison loop * simplify samples loop * add rest/gRPC conversion tests * fix conversions + tests --------- Co-authored-by: George <george.panchuk@qdrant.tech> Co-authored-by: generall <andrey@vasnetsov.com> Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
* fix: fix docstrings to make sphinx happy * debug: downgrade poetry version * fix: update virtualenv * debug: remove debug line
…nt#813) * fix: Raise if named vector not found in local mode * fix: Raise if named vector not found in local mode while upsert * chore: Added test case
* fix: fix dbsf on empty responses, add tests * fix: fix type hints
* fix: fix resolve prefetch input * fix: regen async
* new: update fastembed to 0.5.0, update numpy version mapping, bump qdrant-client to v1.12.2 * new: update qdrant version in integration tests * update lock * drop python3.8 * fix numpy for type checkers * fix netlify * fix netlify
* new: update previous qdrant version * new: rollback rest client as types moved to the core * new: add model_fields_set pydantic compat * new: add Document to models * new: add local inference inspectors * new: add inference functionality to qdrant client * fix: fix type hints * fix: fix type hints * fix: fix type hints * new: remove _cloud_inference arg from methods * refactor * tests: update tests, add path check * fix: fix type hint * fix: fix type hint * fix: resolve plain query * fix: remove redundant checks * fix: fix resolve query doc * tests: add test case for several docs in prefetch * fix: fix tests * new: forbid cloud inference with local mode * fix: fix is_query assignment, fix embed dict * tests: fix sparse vector values comparison * fix: regen async * fix: embed batch * tests: extend local inference tests * tests: add update operations and update vectors tests * tests: remove redundant tests, add plain query points test * fix: fix type hint * fix: add missing import * fix: yet another type hint fix * tests: add query points groups and query batch points tests * fix: do not try to embed a vector, comment missed disabled test stmt * new: add late interaction embeddings without add and query methods * fix: fix LITE import * fix: fix problem with retrieving not available path, enable tests * fix: fix exception message * refactor: update type hint * fix: update type hints * chore: add docstrings to embed methods * refactor: simplify inspector init * fix: fix type hint * new: reuse parser, fix type import * refactor: rename parser, add docstrings * fix: fix type hint * fix: fix type hint * fix: fix type hint * refactor: smol refactor, docstrings * fix: fix inspect embed * deprecation warning for grpc.PointStruct * new: populate inspections cache (qdrant#823) * new: populate inspections cache * fix: fix type hints * fix: regen async * fix: fix type hint * fix: fix typo in filename * fix: fix points check * fix: fix type hint
* remap tag with api.qdrant.tech * re re-gen * fix: Updated accessors * regen with py 3.10.15 --------- Co-authored-by: Anush008 <anushshetty90@gmail.com>
* new: propagate model params in document options * new: update fastembed version * fix: fix option propagation, add tests * fix: update poetry lock * fix: don't change the set model on embed raw types * tests: extend propagate options test * fix: erase cls model storage after each test
…ant#1412) * fix: slice index error message reports an off-by-one upper bound The guard accepts `0 <= index < total`, so the largest valid index is `total - 1`, but the message advertises the range as `0..{total}`. With `total=4`, rejecting `index=4` reports "Slice index must be in 0..4, got 4", naming the rejected value as though it were allowed. Report `0..{total - 1}` instead. * fix slice error message in local mode --------- Co-authored-by: George <george.panchuk@qdrant.tech>
* fix(local): honor nested json-path keys in delete_payload In local mode delete_payload only removed top-level dict keys, so a key given as a json path (`a.b`, `location[0].name`, `location[].name`) never matched and the delete was a silent no-op. The server deletes nested keys via dot notation and preserves the rest of the payload, so local mode diverged from it. set_payload and filters already resolve these paths through parse_json_path; delete_payload was the one payload operation ignoring them. Add a delete_value_by_key helper next to set_value_by_key that walks the same JsonPathItem path and removes the leaf (a missing path is a no-op, siblings are preserved), and use it from delete_payload. * fix(local): match server semantics for indexed payload deletion delete_value_by_key deleted terminal array elements by index and honored Python-style negative indices, but the server does neither: it treats a terminal array-index delete as a no-op (not idempotent) and addresses elements with an unsigned index, so a negative index cannot be represented. Both cases diverged from the server this path exists to mirror. Make a terminal array index a no-op and require a non-negative, in-range index for nested traversal. Add local and congruence coverage for terminal and negative indices. * fix: update json path parser, do not apply partial updates in delete by key, add tests * fix: remove new redundant top level directory --------- Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
…qdrant#1414) * fix(local): skip bool group-by keys to match server GroupId semantics * fix: do not hard code types, move tests to test group search --------- Co-authored-by: feiiiiii5 <feiiiiii5@users.noreply.github.com> Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
…ntics (qdrant#1416) * fix(local): skip bool payload values in order_by to match server semantics * refactor: move tests to congruence, remove excess comments --------- Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
…r gRPC (qdrant#1408) * fix(conversion): keep an absent UpdateResult.operation_id as None over gRPC `UpdateResult.operation_id` is declared `optional uint64` in points.proto, so it carries explicit presence. The server leaves it unset for updates that were never assigned a sequence number - a delete-by-filter that matched no points, a clock-rejected update, or a write to a custom-sharded collection that has no shard keys yet. `GrpcToRest.convert_update_result` read the field unconditionally, so the proto default surfaced as `operation_id=0` while the same update over REST (where the key is omitted from the body) yields `operation_id=None`. Since 0 is also a valid operation id, callers could not tell the two apart. Guard the read with `HasField`, matching the presence handling already used for the neighbouring optional fields in this module. * fix(conversion): keep an absent CollectionInfo.points_count as None over gRPC `points_count` is `optional uint64` in collections.proto, so it carries explicit presence and the server may leave it unset when the count is not available. `GrpcToRest.convert_collection_info` read it unconditionally, so `get_collection` over gRPC reported `points_count=0` where the REST client reports `None`, turning "count unavailable" into "collection is empty". The sibling `indexed_vectors_count` on the next line is already guarded with `HasField`. Guard `points_count` the same way. * tests: extend tests --------- Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
…lback (qdrant#1350) * fix(datetime): only complete an hour-only UTC offset in the parse fallback parse() appended ":00" to any string the format list rejected. The retry exists to turn a trailing "+01" into "+01:00", but unguarded it also completed truncated datetimes: "2024-06-15 12" became "2024-06-15 12:00" and "2024-06-15T12:30" became "2024-06-15T12:30:00", both of which then matched. Local mode therefore accepted datetimes qdrant core rejects. Guard the retry on the string actually ending in an hour-only offset. Fixes: qdrant#1349 * fix: remove regex, move tests * fix: fix datetime parsing to be closer to the server --------- Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
* fix: naive datetime in order by * fix: fix exact datetime precision Co-Authored-By: Nimra Khalid <nimra3261@gmail.com>
…None (qdrant#1338) GrpcToRest.convert_start_from is the only oneof-dispatching converter in conversion.py without the trailing "invalid ... model" guard that the other 136 conversions use -- including its own mirror, RestToGrpc.convert_start_from. When a grpc.OrderBy carries a present-but-empty StartFrom, HasField("start_from") is true, none of the four inner branches match, and the function falls off the end returning None despite being annotated -> rest.StartFrom. The ordering anchor is then silently dropped from the resulting rest.OrderBy rather than reported. Signed-off-by: Anai-Guo <antai12232931@anaiguo.com>
) * fix: validate sparse vectors with raises instead of asserts validate_sparse_vector checks user input, but does so with `assert`. python -O strips assert statements, so under -O the checks disappear entirely and a malformed sparse vector is accepted into a local collection: $ python -O >>> client.upsert("t", [PointStruct(id=1, vector={"s": SparseVector( ... indices=[1, 1, 1], values=[1.0, 1.0, 1.0])})]) # accepted The damage surfaces later rather than at the point of the mistake. A vector whose indices and values have different lengths is stored, and a subsequent query raises from deep inside the search path: >>> client.query_points("t", query=SparseVector(indices=[3], values=[1.0]), using="s") IndexError: list index out of range Raise ValueError instead. This also stops user input being reported as an AssertionError, which is inconsistent with the rest of the client. * refactor: replace assert error with value error * fix: validate vectors before write * fix: add validation for update vectors and batch update points * fix: validate vector dimensions and batch arguments before write --------- Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
* fix: reject negative score indices in formula variables
qdrant core represents the score variable index as a usize
(VariableId::Score(usize)), so "$score[-1]" is not a valid pattern.
parse_variable used int(), which accepts a sign, underscore separators
and surrounding whitespace, and evaluate_variable then bounds-checks
with `var < len(scores)` -- a check that assumes a non-negative index.
A negative index therefore passed the check and read a prefetch from the
end of the list, while an out-of-range positive index correctly fell
back to the default score:
scores = [{1: 10.0}, {1: 20.0}, {1: 30.0}]
"$score[3]" -> 0.0 (default, correct)
"$score[-1]" -> 30.0 (silently the last prefetch)
"$score[-9]" -> IndexError
Validate the index against the same grammar as core instead.
This is the same class of bug as the json path array index fixed in
qdrant#1340, in the formula parser rather than the payload one.
* fix: move tests into local tests
---------
Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
* fix: support FieldCondition.is_empty/is_null in local mode
`FieldCondition` carries `is_empty` and `is_null` as the shorthand syntax for
`IsEmptyCondition` / `IsNullCondition`, and both are wired up for REST and gRPC.
Local mode's `check_condition()` never inspected them, so a `FieldCondition`
carrying `is_empty=`/`is_null=` matched none of the `if` branches and fell
through to the trailing `return False`.
The condition was therefore False for every point, silently: `must` matched
nothing and `must_not` matched everything, with no warning and no
`NotImplementedError`. That affects scroll, count, query_points, facet and
delete(filter=...).
Behaviour was established by running the queries against qdrant/qdrant:dev
rather than by reading core, and is pinned by a congruence test:
- a value is empty when it is null or an empty array; a key holding no value
counts as empty but not null
- a value is null when it is null or an array containing a null
- for a key resolving to several values, any one of them satisfying the
condition is a match, so one point can satisfy both `is_empty=True` and
`is_empty=False`
A condition that also carries `values_count` is left to the existing
`values_count` branch, so its behaviour is unchanged.
Note that on a field without a payload index the server does not treat
`is_null` and `IsNullCondition` as interchangeable, even though the generated
models describe them as alternative syntax: the verbose condition tests the
values a key resolves to, so an array holding a null is not itself null, while
the shorthand looks inside it. Local mode does not model payload indexes, so it
mirrors the unindexed behaviour here, as the surrounding branches already do.
Values are extracted with `flat=False`, like the neighbouring
`IsEmptyCondition`/`IsNullCondition` branches. It is load-bearing:
`{"field": []}` flattens to `None`, which would otherwise collapse the
empty-array case into the no-value case.
* test: compare count() as well as scroll() for is_empty/is_null
The conditions reach every filtered operation, so compare a second one that
shares the filter path rather than only scroll.
* refactor: share the is_empty/is_null value checks in local mode
* fix: make is empty in local mode work as indexed is empty in remote
---------
Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
* fix local query parameter validation * fix: validate more local query bounds, move tests to congruence --------- Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
* fix(local): ignore nonnumeric coordinates in geo filters * fix(local): reject nonfinite geo coordinates * test: cover geo coordinate validation where the filter tests live --------- Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
…drant#1429) * fix: reject 0 raised to a negative exponent in formula PowExpression evaluate_expression's PowExpression branch let base == 0 through the base >= 0 check regardless of the exponent's sign, then called math.pow(0, exponent). For a negative exponent this is a pole (division by zero) and math.pow raises a raw ValueError: math domain error, instead of the library's own raise_non_finite_error message that every other non-finite case in this function produces. Split the base >= 0 check into base > 0 (always fine) and base == 0 (fine only for a non-negative exponent), leaving the existing base < 0 integer-exponent branch untouched. 0 raised to a non-negative exponent still returns the expected value (0**0 == 1, 0**3 == 0). Adds test_pow_expression to qdrant_client/local/tests/test_formula.py covering the previously-passing cases plus the new negative-exponent regression, alongside the existing negative-base non-integer-exponent case. * fix: match core's non-finite handling in formula pow --------- Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
…drant#1434) * fix(local): honor str and non-list Sequence selectors in local mode In local mode, with_vectors="name" or a tuple like ("name",) silently returned all vectors instead of the named subset, and with_payload="key" or ("key",) returned the whole payload instead of the filtered keys. Both parameters are typed as bool | Sequence[str], so a bare string or a tuple is a valid selector, but only list instances were recognized. Normalize a bare string to a single-element list and match any Sequence, so local mode honors the documented contract instead of silently returning everything. Signed-off-by: betacatsling <113584199+betacatsling@users.noreply.github.com> * fix: update with_payload and with_vectors types * fix: fix local with vectors test --------- Signed-off-by: betacatsling <113584199+betacatsling@users.noreply.github.com> Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
…tes (qdrant#1420) * fix(local): apply MMR offset to the re-ranked output, not the candidates Local mode passed `offset` to the candidate search inside `_search_with_mmr` and then returned the first `limit` MMR picks unsliced. That both hid the top `offset` nearest points from MMR and silently returned page 1 for every page request. Core plans MMR the other way around: the candidate `CoreSearchRequest` is built with `offset: 0` and `limit: candidates_limit`, the MMR rescore stage gets `limit + offset`, and the offset is cut off afterwards (lib/shard/src/query/planned_query.rs). Match that: search candidates with offset 0, re-rank `limit + offset` points, slice off the offset. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * tests: rephrase the comment, move tests to congruence --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
* fix(local): isolate sparse vectors at storage boundaries * fix: replace deepcopy with a cheap copy --------- Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
* fix(local): update IDF statistics on deletion * fix: update IDF statistics on deletion, reject writes to absent points, apply the rest --------- Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
* fix(local): isolate payload values across wildcard targets * refactor: copy once per wildcard element, move the tests to local --------- Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
✅ Deploy Preview for poetic-froyo-8baba7 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
devbranch. Did you create your branch fromdev?New Feature Submissions:
pre-commitwithpip3 install pre-commitand set up hooks withpre-commit install?Changes to Core Features: