fix: make strict datetime filter comparison opt-in - #12257
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||
sjrl
marked this pull request as ready for review
August 6, 2026 11:51
sjrl
requested review from
davidsbatista and
julian-risch
and removed request for
a team and
davidsbatista
August 6, 2026 11:51
Contributor
Author
|
@julian-risch I've requested your review since you reviewed the most recent PR that introduced the discrepancy between equality and ordering for datetime comparisons so I believe you have the most context! |
julian-risch
requested changes
Aug 6, 2026
julian-risch
left a comment
Member
There was a problem hiding this comment.
Thanks a lot! Much better! Two things:
- We should delete releasenotes/notes/fix-equality-iso-date-filter-4b7c9d2e1f6a8b03.yaml (the one from #11963 ). Technically not blocking this PR so I can also do that in a separate PR.
- There is an issue with indentation of
:param strict_datetime_comparison:. pre-existing issue for:param output_type:too. See the rendering: https://docs.haystack.deepset.ai/reference/next/routers-api#metadatarouter
Contributor
Author
|
@julian-risch both comments addressed in e5d6e0a |
julian-risch
approved these changes
Aug 7, 2026
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
Proposed Changes:
Of the options listed in #12246, I opted for “equality could start reconciling,” aligning equality with the existing ordering behavior. Reconciliation can be disabled by setting the new keyword-only parameter
strict_datetime_comparison=True. In strict mode, mixed timezone-aware and timezone-naive values are treated as non-matching rather than raising an error.Added an opt-in
strict_datetime_comparisonkeyword argument todocument_matches_filter,InMemoryDocumentStore, andMetadataRouter. When enabled, timezone-naive and timezone-aware datetimes never match each other. By default, mixed-awareness datetimes continue to be reconciled by copying the timezone from the aware value to the naive one, and this behavior is now consistent across equality, membership, and ordering operators.How did you test it?
New and existing tests
Notes for the reviewer
Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:and added!in case the PR includes breaking changes.