-
Notifications
You must be signed in to change notification settings - Fork 2
supporting datemath for between operator #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| } | ||
|
|
||
| // NewDateConverter takes a node expression | ||
| func NewDateConverter(ctx expr.EvalIncludeContext, n expr.Node) (*DateConverter, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some tests that this behavior matches the timewindow function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
our timewindow stuff is pretty different from this BETWEEN stuff 🤷🏻
https://github.com/lytics/lio/blob/0ca70f714134aedc089b898c2425c5251363c1bd/src/custdata/entity/timebuckets.go#L490-L498
vm/datemath.go
Outdated
| // and "exits" the expression by passing the lower bound and sliding out of the window. Although the "Upper Bound" is after the "Lower Bound", | ||
| // the order of entry and exit is reversed. This example should show how the entity appears to move backwards as the window moves forward. | ||
| // Example timeline: Ct = 01/22/2025 00:00:00 | ||
| // Day 0: now = 01/22/2025 00:00:00 === Lb--Ct++Ub+++++++++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a little confusion on first read - can you add a comment to explain the -/+ here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a bit my fault... It was supposed to represent some static days
Ct is static day, and --- was supposed to be the days before that, with a + representing a day after that... which would sort of help visualize the window sliding forward... so some of those minuses in the last 4 lines here should actually be + in that regard.
There is probably a better way to indicate the different timings, but pretty sure Suman just grabbed this directly from the markup I drafted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I will clean it up. It looked good so thought will help in the future knowing whats going on.
2688180 to
a1fa259
Compare
f917bac to
f02c936
Compare
This PR supports datemath for the between operator where both date arguments are the valid date eval expression like "now-1d" .