Support for the `Duration` data type
Describe your feature request
It seems to be the Duration data types is not exposed to JS - https://github.com/search?q=repo%3Apola-rs%2Fnodejs-polars%20duration&type=code
@roll Do you mind putting a PR for it? I see a lot of references to duration in Python Polars and not sure which feature we need to add. Thx
I made good progress on adding Duration data type, but since JS does not have a duration data type, not sure how to proceed.
Python has timedelta and there is experimental JS Temporal.Duration but it's a long way from proceeding.
Hi, sorry I didn't have a chance yet to take a look.
My thinking was that we can use a Temporal polyfill:
- https://github.com/fullcalendar/temporal-polyfill
- https://github.com/js-temporal/temporal-polyfill
The working group says that "This proposal is now in the hands of ECMAScript engine implementers, so the bar for making API changes is extremely high" making that this exact API will become a standard JS soon.
As an other option, can it just be a string in JS? At least, for my case it will be sufficient to be able to manipulate durations within dataframes. Of course, full implementation would be nicer in-general.
Maybe we do not need Temporal.Duration since we are already constructing Duration type.
Enhancing the Duration type to include all the attributes maybe sufficient.
I have a WIP branch for duration type, but tests are failing. Need to figure out why.
Great news! I try to test it next week
Thanks!