Repository navigation
test: add openapi regression test for values_count on missing fields - #9606
Conversation
Reproduces #9586 where points with a missing payload field are not matched by values_count filters that should treat the count as 0. Co-authored-by: Cursor <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change updates Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
Follow the standard openapi test structure with setup/teardown fixture instead of explicit drop_collection calls in the test body. Co-authored-by: Cursor <[email protected]>
`FieldCondition::check_empty()` ignored the `values_count` condition, so a point with a missing payload field was never matched by a `values_count` filter. The desired semantics (and the existing `ValuesCount::check_empty`) treat a missing field as having a value count of 0. Forward the empty check to `values_count.check_empty()` so bounds like `lt: 1`, `gte: 0` and `lte: 0` correctly match points whose field is absent. Fixes #9586 Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
…9606) * test: add openapi regression test for values_count on missing fields Reproduces #9586 where points with a missing payload field are not matched by values_count filters that should treat the count as 0. Co-authored-by: Cursor <[email protected]> * test: use module fixture for values_count missing field test Follow the standard openapi test structure with setup/teardown fixture instead of explicit drop_collection calls in the test body. Co-authored-by: Cursor <[email protected]> * fix: treat missing field as count 0 for values_count filter (#9607) `FieldCondition::check_empty()` ignored the `values_count` condition, so a point with a missing payload field was never matched by a `values_count` filter. The desired semantics (and the existing `ValuesCount::check_empty`) treat a missing field as having a value count of 0. Forward the empty check to `values_count.check_empty()` so bounds like `lt: 1`, `gte: 0` and `lte: 0` correctly match points whose field is absent. Fixes #9586 Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Cursor <[email protected]> Co-authored-by: Andrey Vasnetsov <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Summary
values_countfilters treat a missing payload field as count0when scrolling pointsTest plan
pytest tests/openapi/test_filter_values_count_missing_field.pyagainst currentdev— test should fail until the fix landsMade with Cursor