fix(local): reject score_threshold with an order_by query - #1532
kabishou11 wants to merge 1 commit into
Conversation
The server answers query_points with an OrderByQuery and a score_threshold (top level or in a prefetch) with 400 "Can't use score_threshold with an order_by query.". Local mode ignored the threshold and returned every ordered point with score 1.0. Raise the same error in query_points, query_points_groups and prefetch validation.
✅ Deploy Preview for poetic-froyo-8baba7 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe synchronous and asynchronous local clients now raise Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The local clients now reject the incompatible query combination, and the supplied coverage identifies no issue requiring a fix before merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
All Submissions:
devbranch. Did you create your branch fromdev?Changes to Core Features:
What and why
The server rejects a
score_thresholdcombined with anorder_byquery, both at the top level and inside a prefetch (checked against Qdrant 1.19.1):Local mode silently ignored the threshold and returned every ordered point with score
1.0, so code that works in:memory:fails against a real server:This adds the same check next to the existing local validation (
_validate_prefetch,query_points,query_points_groups) inQdrantLocalandAsyncQdrantLocal.SampleQuerywith a threshold is accepted by the server, so it is left unchanged.Tests
tests/congruence_tests/test_query.py::test_query_orderby_with_score_threshold_is_rejectedchecks the top-level and prefetch cases: local raisesValueError, REST raisesUnexpectedResponse, gRPC raisesRpcError. It fails ondevand passes with the change (Qdrant 1.19.1 server). The existing order-by congruence tests still pass, andpre-commit runon the changed files passes.