Repository navigation
Conversation
evan-gordon
reviewed
Sep 12, 2025
evan-gordon
left a comment
Collaborator
There was a problem hiding this comment.
Overall looks good! Mostly just a few cosmetic comments.
| var includedIn bool | ||
|
|
||
| // Handle null bounds | ||
| if result.IsNull(leftStart) || result.IsNull(leftEnd) || result.IsNull(rightStart) || result.IsNull(rightEnd) { |
Collaborator
There was a problem hiding this comment.
Wouldn't this not work in the case of Intverval(null, 1] and Interval[5, null) where we can definitively say that one is not included in the other? Consider adding a test for this sort of a case.
|
|
||
| includedIn = (startComp == leftBeforeRight || startComp == leftEqualRight) && | ||
| (endComp == leftBeforeRight || endComp == leftEqualRight) | ||
| } else { |
Collaborator
There was a problem hiding this comment.
I think we could use a helper method similar to
cql/interpreter/operator_arithmetic.go
Line 321 in 25fd8b5
| } | ||
|
|
||
| // Check units match | ||
| if leftStartQty.Unit != rightStartQty.Unit || leftEndQty.Unit != rightEndQty.Unit { |
Collaborator
There was a problem hiding this comment.
mind using the ucum lib here? that should rather easily allow for handling this case.
…bounds, ucum ProperlyIncludedIn for intervals now compares the closed start and end of both intervals through one helper, compareIntervalPoints, built on a generic compareValues. Quantity points convert units with the ucum library instead of rejecting differing units. An unknown start is bounded by the interval's end (and an unknown end by its start), so Interval(null, 1] properly included in Interval[5, null) returns false instead of null. Comparing the normalised bounds also fixes two cases the old equality check got wrong: Interval[1, 5] and Interval[1, 6) are the same interval, and Quantity and Time bounds were compared as zero floats. The QuantityIntervalProperlyIncludedInTrue and TimeProperlyIncludedInTrue spec tests now pass. IntegerIntervalProperlyIncludedInNullBoundaries stays excluded under the existing ambiguous-match bug, because Interval[null, null] does not resolve in the parser. The Interval<String> overload is removed: the Interval selector has no String overload, so it could not be reached.
vfrank66
force-pushed
the
issue_140-properlyincludesin-add-intervals
branch
from
October 11, 2026 17:12
cb6650e to
988b0ba
Compare
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.
No description provided.