pola-rs / polars-xdt

Polars plugin offering eXtra stuff for DateTimes
https://marcogorelli.github.io/polars-xdt-docs/
MIT License
187 stars 8 forks source link

Use holidays crate #53

Closed ion-elgreco closed 9 months ago

ion-elgreco commented 10 months ago

We can use the holidays crate https://docs.rs/holidays/latest/holidays/index.html in the areas where we can pass holidays

ion-elgreco commented 9 months ago

Here is a working version of it: https://github.com/ion-elgreco/polars-xdt/blob/feat/holidays_range/src/holiday.rs

Sadly, it's only limited to years falling between 2000 and 2030

MarcoGorelli commented 9 months ago

thanks! might be better to let users pass in their own holidays then?

ion-elgreco commented 9 months ago

Likely better, you get 100x speed ups though with the xdt.holiday_range :P