Files
Madan kumar 532997a781 Fix local mode filters cross-matching booleans and integers (#1259)
* Fix local mode filters cross-matching booleans and integers

Python treats bool as a subclass of int (True == 1, False == 0), but Qdrant
keeps booleans and integers as distinct payload value types. Local mode
compared them with a plain `==` / `in` / `isinstance(value, (int, float))`, so:

- MatchValue(value=1) matched a payload of True, and MatchValue(value=True)
  matched a payload of 1 (same for 0 / False)
- MatchAny / MatchExcept cross-matched the same way
- Range matched booleans as if they were 0 / 1

The server never cross-matches these (its ValueVariants keeps Integer and Bool
distinct, and booleans are not numeric for range conditions). Add a type-aware
equality helper used by the value-match conditions, and exclude booleans from
range checks. Adds an in-memory regression test.

* Cover MatchExcept in the bool/int cross-match test

MatchExcept also routes through values_match, so assert that except=[1]
keeps the True payload (bool is not the integer 1).

* Add isolated MatchAny and range asserts to the bool/int cross-match test

Lock the single-value MatchAny path and the check_range bool guard against
regressions, in addition to the existing combined-condition coverage.

* fix: handle floats in cross-match local mode filters, add congruence tests

---------

Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
2026-07-22 02:17:20 +07:00
..
2023-03-28 14:57:05 +02:00
2023-07-21 23:15:25 +02:00
2024-11-15 15:54:32 +01:00
2025-12-05 16:32:24 +07:00
2025-12-05 16:32:24 +07:00
2024-11-15 15:54:32 +01:00
2025-12-05 16:32:24 +07:00
2025-01-06 11:44:25 +00:00
2024-08-08 16:56:21 +02:00
2025-12-05 16:32:24 +07:00
2025-12-04 11:22:46 +07:00