-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: Implement dt.days_in_month
function
#23119
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
1d5381d
to
e8f02e8
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #23119 +/- ##
==========================================
+ Coverage 81.44% 81.46% +0.01%
==========================================
Files 1655 1663 +8
Lines 224589 224634 +45
Branches 2881 2881
==========================================
+ Hits 182923 182994 +71
+ Misses 40949 40923 -26
Partials 717 717 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
thanks for your pr this looks like it's off to a good start, but quite a few lines are reported as uncovered - could you make sure your tests cover them all (or at least, nearly all?) please? |
@MarcoGorelli Thanks for the feedback! I’ll work on improving the test coverage. |
@MarcoGorelli Is the coverage in |
370d604
to
373ae72
Compare
thanks for updating! could you fetch and rebase onto the polars main branch please? there's some unrelated changes in https://github.com/pola-rs/polars/pull/23119/files which make it harder to review |
4b0cf33
to
77e158e
Compare
@MarcoGorelli I've finished rebasing onto the main branch. |
thanks! will try to get to this in the coming week |
fc3a4e6
to
13a48d0
Compare
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 @mrkn ! all looks good
my only suggestion is - rather than adding an extra pattern to to_temporal_unit
, to make a separate macro. this is partially to keep to_temporal_unit
simple, but also because I'm not sure that "days in month" qualifies as a temporal unit
apart from that, this looks good to me, thanks for sticking with it 💪
@MarcoGorelli Thanks for the review! Understood—I’ll try separating the macro as you suggested. I was also unsure whether |
d75a7ca
to
0b74444
Compare
@MarcoGorelli, I've updated the branch. I extracted the second variant of the |
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 @mrkn , looks good to me!
Implements
dt.days_in_month()
for Date and Datetime columns.Uses the existing
DAYS_PER_MONTH
array andis_leap_year()
function for performance instead of chrono'snum_days_in_month()
.This is my first contribution to a Rust project. As a Rust beginner, I'd appreciate thorough code review and feedback to help me improve.
Fixes #14193