-
Notifications
You must be signed in to change notification settings - Fork 8
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
[NEW] month_delta
function
#57
Conversation
Work In Progress Issues:
|
this looks fine to be honest say you want to count the whole months between the result is the smallest |
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.
is this correct? shouldn't it be 11?
(Pdb) pl.select(xdt.month_delta(dt.date(1970, 1, 2), dt.date(1971, 1, 1)))
shape: (1, 1)
┌─────────┐
│ literal │
│ --- │
│ i32 │
╞═════════╡
│ 12 │
└─────────┘
Fixed, there was unnecessary month comparison NOTE: Added this to test section too. |
thanks for updating! OK I think the results are correct. Or at least, I wasn't able to break it, even with I'll do another check of the code, and of the performance, as I'd like to think this can be simplified |
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.
thanks @akmalsoliev !
#66 just fyi (now that we've got a hypothesis test in, we can confidently optimise away 😎 ) |
The month_diff function computes the integer representation of the month difference between two dates. The resulting values can be both positive and negative, signifying whether the comparative shift from the target date is to the past or the future, respectively.