Skip to content

test: add openapi regression test for values_count on missing fields - #9606

Merged
generall merged 3 commits into
devfrom
test/values-count-missing-field-9586
Jun 29, 2026
Merged

generall merged 3 commits into
devfrom
test/values-count-missing-field-9586

Conversation

@qdrant-cloud-bot

Copy link
Copy Markdown
Contributor

Summary

Test plan

Made with Cursor

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]>
@coderabbitai

coderabbitai Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: afc5a0d3-9695-4e76-bdf0-60bb7a6250b0

📥 Commits

Reviewing files that changed from the base of the PR and between 87dc202 and 0ec699c.

📒 Files selected for processing (1)
  • lib/segment/src/payload_storage/condition_checker.rs

📝 Walkthrough

Walkthrough

The change updates FieldCondition::check_empty so values_count is evaluated when a payload field is missing. It also adds regression coverage in Rust and OpenAPI tests that create points with and without tags, query values_count through /points/scroll, and assert the expected matches for lt, gte, and lte.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

🐇 I hopped through fields both filled and bare,
And counted “zero” in the missing air.
With scrolls and tests, the burrow glows,
lt, gte, lte—the bunny knows.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the new regression test for values_count behavior on missing payload fields.
Description check ✅ Passed The description matches the change and test plan for the OpenAPI regression test about missing fields counting as 0.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

qdrant-cloud-bot and others added 2 commits June 29, 2026 06:07
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]>
@generall
generall merged commit 7b25a08 into dev Jun 29, 2026
12 of 13 checks passed
@generall
generall deleted the test/values-count-missing-field-9586 branch June 29, 2026 06:47
generall added a commit that referenced this pull request Aug 4, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants