mirror of
https://github.com/qdrant/qdrant-client.git
synced 2026-07-29 14:11:34 -05:00
* 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>