Skip to content

Fix nanosecond precision in local datetime range filters - #1527

Open
LE0-Lin wants to merge 1 commit into
qdrant:devfrom
LE0-Lin:fix/datetime-range-nanoseconds
Open

LE0-Lin wants to merge 1 commit into
qdrant:devfrom
LE0-Lin:fix/datetime-range-nanoseconds

Conversation

@LE0-Lin

@LE0-Lin LE0-Lin commented Oct 4, 2026

Copy link
Copy Markdown

Local datetime filters currently truncate payload fractions to microseconds: ...000000001Z incorrectly satisfies lte=...000000Z and fails the corresponding gt. Preserve the sub-microsecond remainder in range comparisons so local results agree with unindexed server filtering, while keeping the existing datetime parser and ordering behavior.

Fixes #1526

Validation:

  • New regression matrix: 12 failed / 28 passed before the source change; all 40 passed afterward.
  • python -m pytest qdrant_client/local/tests -q: 176 passed.
  • 20 public-client boundary queries against official Qdrant 1.19.1: local, REST, and gRPC results agree after the fix.
  • pre-commit run --files qdrant_client/local/payload_filters.py qdrant_client/local/tests/test_datetimes.py: passed.
  • git diff --check: passed.

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Codex assisted with diagnosis, implementation, and test execution. The reported results are from the assisted environment (Python 3.12.0, Windows); this disclosure does not assert independent manual review or execution by the human contributor. The full remote/fastembed suite was not run.

Signed-off-by: Zhibo Lin <147509942+LE0-Lin@users.noreply.github.com>
@LE0-Lin
LE0-Lin requested a review from joein as a code owner October 4, 2026 06:38
@netlify

netlify Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for poetic-froyo-8baba7 ready!

Name Link
🔨 Latest commit 001589e
🔍 Latest deploy log https://app.netlify.com/projects/poetic-froyo-8baba7/deploys/6ac1f47ae4291c0008a754a5
😎 Deploy Preview https://deploy-preview-1527--poetic-froyo-8baba7.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Oct 4, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0331e41a-9d75-4f2c-8df1-87ff3235df5f
📥 Commits

Reviewing files that changed from the base of the PR and between c729303 and 001589e.

📒 Files selected for processing (2)
  • qdrant_client/local/payload_filters.py
  • qdrant_client/local/tests/test_datetimes.py

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

Local datetime range filtering now retains nanosecond precision when comparing timestamps with range boundaries. Parameterized tests check lt, lte, gt, and gte, including sub-microsecond values, offset-equivalent timestamps, a pre-epoch timestamp, and exact equality.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 00158

Local datetime range filters now distinguish timestamps that differ below one microsecond. Timestamps with six or fewer fractional digits are handled correctly. No outstanding merge-blocking issue remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. 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 and concisely identifies the main change: preserving nanosecond precision in local datetime range filters.
Description check ✅ Passed The description explains the precision issue, the fix, and the validation performed. It is directly related to the changeset.
Linked Issues check ✅ Passed Issue #1526 requires local datetime range comparisons to preserve sub-microsecond payload precision. check_datetime_range now compares the parsed datetime and the remaining nanosecond digits against…
Out of Scope Changes check ✅ Passed The reported changes are limited to check_datetime_range and datetime-range regression tests. Both support issue #1526. The available change summary and inspected code show no unrelated changes.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

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.

1 participant