-
-
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
wip: Support to_string
for Duration dtype
#19663
wip: Support to_string
for Duration dtype
#19663
Conversation
I understand the feature, but it feels to me more like a formatting functionality than a cast. I think a |
daa2078
to
a3de5d0
Compare
Yup, can redo it inside a We would have to output (It would be nice to be able to get the same form we display for some purposes; maybe that's why it felt like a cast 🤔) |
7437325
to
3e3b435
Compare
We already have |
Ok, can look at turning it into an ISO8601 duration via The other temporal types default to their respective ISO format via (Parking in Draft; will come back and finish it up tomorrow) |
3e3b435
to
f3a4a47
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #19663 +/- ##
=======================================
Coverage 79.73% 79.73%
=======================================
Files 1542 1542
Lines 212223 212291 +68
Branches 2449 2450 +1
=======================================
+ Hits 169216 169272 +56
- Misses 42453 42465 +12
Partials 554 554 ☔ View full report in Codecov by Sentry. |
4d8fdeb
to
6b6850c
Compare
cast
from Duration to Stringto_string
for Duration dtype
20bbaed
to
ffe3eab
Compare
to_string
for Duration dtypeto_string
for Duration dtype
2ef9b27
to
5182dee
Compare
5182dee
to
11cf274
Compare
Ok, think I've got it; will re-open under a fresh PR 👌 |
Closes #7174.
Consolidates four
duration
formatting functions (used to convert Duration to String when printing the framerepr
) into one, and enables reuse of this function for casting to string.Note: This seems like the most reasonable/consistent
cast
; turning a duration into a specific type of string (such as ISO8601 format1) should be done with a dedicated expression.Example
Footnotes
ISO 8601 duration format ↩