Fix empty hybrid_search results and refresh index in integration test#222
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThis PR fixes ChangesEmpty rows result handling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 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 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 |
…oceanbase#222) ## Summary - Remove the early return in `_transform_sql_result` for empty `result_rows`, so empty hybrid/search results respect the `include` parameter instead of always returning all columns. - Add unit tests covering empty-result shape for `include=None`, `include=[]`, and `include=["embeddings"]`. - Call `collection.refresh_index()` before hybrid search in the integration test so index state is ready after recent `refresh_index`-before-query behavior (oceanbase#217). ## Test plan - [x] `uv run pytest tests/unit_tests/test_hybrid_search_source_inference.py` - [ ] `uv run pytest tests/integration_tests/test_collection_hybrid_search_source_inference.py` (requires real DB) Made with [Cursor](https://cursor.com) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed handling of empty search results to return consistent column structures based on the requested data types. * **Tests** * Added test coverage for empty result scenarios to verify correct column structure across various configuration options. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/oceanbase/pyseekdb/pull/222?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
_transform_sql_resultfor emptyresult_rows, so empty hybrid/search results respect theincludeparameter instead of always returning all columns.include=None,include=[], andinclude=["embeddings"].collection.refresh_index()before hybrid search in the integration test so index state is ready after recentrefresh_index-before-query behavior (calling refresh_index before query #217).Test plan
uv run pytest tests/unit_tests/test_hybrid_search_source_inference.pyuv run pytest tests/integration_tests/test_collection_hybrid_search_source_inference.py(requires real DB)Made with Cursor
Summary by CodeRabbit
Bug Fixes
Tests