Repository navigation
fix: complete partial dates to start of period in range filters - #13342
Conversation
Updated date parsing to handle partial dates consistently.
Added regression test to ensure partial dates resolve to the start of the period instead of the current date.
Fixes the behavior of filter range operators for partial dates to complete them to the start of the period, preventing silent drops of matching documents.
|
@zhgao is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @zhgao, thanks a lot for your contribution! 🙏 We noticed that the Contributor License Agreement (CLA) check ( To get your PR reviewed, please sign the CLA via the link in the |
|
Thanks for signing the CLA, @zhgao! 🎉 This PR is now ready for review again and the reviewer has been re-assigned. |
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||
|
hey @zhgao pinging to ask if you have time to work on this |
Fixes #13338.
When range operators (
>,>=,<,<=) receive partial dates like"2024"or"2024-06", the missing month/day were filled from today's date, so>= "2024"silently dropped ~9.5 months of data — and results changed day to day. This PR passesdefault=datetime(1, 1, 1)to the dateutil fallback so partial dates complete to the start of the period ("2024"→2024-01-01). The==/!=paths are unaffected.Tests: 7 new regression tests (3 fail on the unfixed code, proving the bug);
test/utils/test_filters.py— 165 passed. The bug was reproduced locally before fixing.Note: this fix was developed with AI assistance; the bug was reproduced locally and the patch is covered by regression tests.