Conversation
The empty-collection fast path in LocalCollection.scroll returned an empty page before the offset/order_by guard, so the same misconfigured scroll only raised once the collection held a point. Move the guard above the fast path so local mode rejects the combination the way the server does, regardless of data.
✅ Deploy Preview for poetic-froyo-8baba7 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthrough
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Suggested reviewers: 🚥 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 |
Problem
In local mode,
scroll()withorder_byandoffsetbehaves differently depending on whether the collection happens to contain any points:The server rejects the
order_by+offsetcombination before it looks at stored points, and local mode does too — but only once a point exists, so a caller sees a successful empty page on an empty collection and the documented error on the identical call later.Cause
LocalCollection.scroll()returns early for an empty collection:That branch deliberately keeps server-side argument validation on the empty path, but the
offset/order_byguard sits further down, inside theorder_bysection (previously atlocal_collection.py:2120), so the early return pre-empts it.Change
Hoist the guard to the top of
scroll(), so the request is rejected before the empty-collection fast path, the same wayvalidate_filteralready is. Behavior foroffsetwithoutorder_by(which is supported) is untouched, andlocal_collection.pyhas no generated async twin, so nothing needs regenerating.Testing
New regression test
qdrant_client/local/tests/test_scroll_validation.pyruns the identical call against an empty and a non-empty collection:589a87a:1 failed, 1 passed— the empty-collection case fails, which is the bug.2 passed.Wider local suites at head:
python -m pytest qdrant_client/local/tests tests/test_in_memory.py -q→145 passed.Repo gates on the changed files:
ruff format --check --line-length=99→2 files already formatted;ruff check→All checks passed!.Notes for the reviewer
local_collection.pyis hand-written (not generated), so there is no async twin to regenerate, and the diff is the 5-line move plus the test.devas the template asks.