-
-
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
depr(python,rust!): Rename dt.seconds
to dt.total_seconds
(likewise for days, hours, minutes, milliseconds, microseconds, and nanoseconds)
#12179
Conversation
… days, hours, minutes, milliseconds, microseconds, and nanoseconds) for temporal types
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.
The original idea of the linked ticket was to have a single method, i.e. dt.seconds
, which would work for both datetime columns (gives you a number between 0 - 59) and for duration columns (gives you the duration in seconds).
However, I think your proposal is better. I like keeping second
, hour
, etc. for datetime types, and then have total_seconds
etc. for duration types. Would be good to get @ritchie46 's signoff here though before we make such changes to the public API.
A few minor comments!
dt.seconds
to dt.total_seconds
(likewise for days, hours, minutes, milliseconds, microseconds, and nanoseconds)
@@ -158,7 +158,7 @@ impl PyExpr { | |||
) | |||
.into() | |||
} | |||
fn duration_hours(&self) -> Self { | |||
fn dt_total_hours(&self) -> Self { |
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.
Looks like these are not on the Rust expression architecture yet - we can add that in a different PR!
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.
Has my blessing! But as I said, since it's a change to the public API, we should run this by @ritchie46 as well.
LGTM. 👍 Thanks for the ping @stinodego |
closes #6445
as mentioned in the issue,
.seconds
looks like.seconds
from pandas / Python stdlib, but it actually equivalent to.total_seconds