Fix date-only range stop dropping the final day (half-open [start, stop)) - #312
Closed
Shadow_Lu (LuShadowX) wants to merge 1 commit into
Closed
Fix date-only range stop dropping the final day (half-open [start, stop))#312Shadow_Lu (LuShadowX) wants to merge 1 commit into
Shadow_Lu (LuShadowX) wants to merge 1 commit into
Conversation
…op)) date_range_from_datetime_range compiled a stop_date with no time to that day's midnight, so "Jan 1 to Jan 5" became [Jan 1 00:00, Jan 5 00:00) and every message on Jan 5 was dropped. A bare date now rolls forward to the next midnight via exclusive_stop_from_date_time(). DateRange.end is documented and implemented as exclusive to match both timestamp index backends, which already filtered exclusively while __contains__ was inclusive. Co-authored-by: bmerkle <232471+bmerkle@users.noreply.github.com>
This was referenced Aug 5, 2026
Collaborator
|
sorry, already fixed in #309 |
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.
Replaces #296 and #309. Bernhard Merkle (@bmerkle) offered on #296 to hand this back to me to land, and I took him up on it; GitHub refused to reopen #296 after the force-push, hence a new PR. The design and the test shape are his — he is credited on the commit.
A
stop_datewith no time compiled to that day's midnight, so "Jan 1 to Jan 5" became[Jan 1 00:00, Jan 5 00:00)and everything on Jan 5 was dropped.searchlang.py: newexclusive_stop_from_date_time(); a date-only stop rolls to the next midnight.interfaces_core.py:DateRange.endis now documented and implemented as exclusive (__contains__uses<), matching both timestamp index backends, which already filtered exclusively.convutils.py: docstring only, warning thatget_time_range_for_conversationreturns an inclusive-looking bound.end is Nonestill means "unbounded" inDateRangebut a point query in the indexes. Left alone — separate decision.make format check test: pyright clean on 3.12 and 3.14, 744 passed, 12 skipped (737 onmain; the 7 new tests are the only difference). The regression test fails onmainand passes here.