-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat: Change mean/median
of Date
columns to return a Datetime
instead of Date
#13492
Conversation
@MarcoGorelli mind adding this one to your to-do so I can continue on with the others? This is probably the worst one since I had to update the streaming code a bit to make the date->datetime conversion work in streaming for mean/median. |
I definitely support changing |
@stinodego it was originally issue #10232 with PR #12902 but it was requested to split into multiple PRs. I can make a separate issue for each PR, including this one. |
Thanks - no need to make separate issues I think. |
@stinodego oops just made one. It's a bit clearer on the issue at least. |
@MarcoGorelli and @reswqa I think I've addressed your issues. Thanks for the review. |
@MarcoGorelli and @reswqa I don't want this to get too stale, as I have a few other PRs in the pipeline that are dependent on this one. Do you have any other suggested changes? Thank you! |
No, I don't. It looks good from my side. But as I am not familiar with temporal thing, I leave the final check before merge to others. |
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.
Generally looks good to me
The parts I don't want to formally approve myself are:
- crates/polars-pipe/src/executors/sinks/group_by/aggregates/mean.rs
- crates/polars-plan/src/logical_plan/aexpr/schema.rs
but it looks like Weijie is happy with them
Hi @stinodego or @ritchie46 can we merge this so I can proceed with the next temporal updates? |
@ritchie46 I hate to harp on this, but it's been sitting in the queue for a while and it's fairly straightforward. Any issues with this PR? I'd like to continue on the other temporal types. |
@stinodego I got a streaming error on here, is this related to the markers again? |
mean/median
of Date
columns to return a Datetime
instead of Date
mean/median
of Date
columns to return a Datetime
instead of Date
mean/median
of Date
columns to return a Datetime
instead of Date
Resolves #13598.
Ref #10232
Part 2 of a series of datetime fixes: implement mean/median for date and return a datetime.
This treats dates and datetimes as analagous to integers/floats: the mean of ints is a float, and now the mean of dates is a datetime:
Changes:
datetime
object from mean/medianpl.Datetime
dtype.dt.mean()
is no longer required for datetime namespace (i.e. has same functionality as s.mean/median).pl.Datetime
.Upcoming related PRs:
Part 3 - mean/median for pl.Duration
Part 4 - mean/median for pl.Time
Part 5 - deprecate mean/median for datetime namespace.