fix(sdk/python): order Stats.Recent by insertion order, not last_confirmed#474
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughStoreStats comments now describe ChangesStoreStats recent ordering
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
…irmed The Python SQLite store sorted Recent units by evidence.last_confirmed descending, diverging from all other store implementations (Go SQLite, Go in-memory, Go PostgreSQL, Python PostgreSQL) which use rowid DESC (insertion order). Replace the in-memory sort with a SQL ORDER BY rowid DESC query to match. Also update the StoreStats.Recent docstring in Go and Python to say "most recently added" instead of "most recently confirmed". Fixes #473
b7bb9c9 to
582748c
Compare
There was a problem hiding this comment.
Pull request overview
Updates the Python SQLite store’s stats() implementation so StoreStats.recent reflects insertion order (most recently added), matching the semantics used by other store backends and SDKs.
Changes:
- Switch Python SQLite
stats()“recent” selection from in-memorylast_confirmedsorting toORDER BY rowid DESC LIMIT ?. - Update Go and Python
StoreStats.Recent/recentdocumentation/comments to say “most recently added”. - Adjust Python test to assert insertion-order behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| sdk/python/tests/test_store.py | Updates the recent ordering test to validate reverse insertion order. |
| sdk/python/src/cq/store.py | Changes SQLite stats() to fetch recent via ORDER BY rowid DESC LIMIT ? and updates the field comment. |
| sdk/go/types.go | Updates StoreStats.Recent comment to align with “most recently added” semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
last_confirmedsort withORDER BY rowid DESC LIMIT ?SQL query in the Python SQLite store'sstats()method, matching all other store implementationsStoreStats.Recentdocstring in Go (sdk/go/types.go) and field comment in Python (sdk/python/src/cq/store.py) to say "most recently added"Test plan
Fixes #473
Summary by CodeRabbit
Bug Fixes
Tests