-
Notifications
You must be signed in to change notification settings - Fork 76
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] Add polars support #305
base: main
Are you sure you want to change the base?
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Hey @elephaint , thanks for trying out Narwhals! We can prioritise pivot as that would be helpful to you We'd previously run into issues with Polars pre1.0 inconsistencies, but from this PR it looks you only need the 1.0+ behaviour, right? Is there anything else we could do in Narwhals to help you out here? |
Thanks! For this PR / repo I think indeed at the moment the only thing I miss is pivot - which I kind of get as it's an expensive op (as most fast frameworks are column based). Another minor thing that would be great is ability to ascertain datatypes at the op level without casting afterwards. For example, doing A thing that I found a bit unintuitive is that Narwhals seems to keep track of the order of a Pandas Integer Index even after narwhallifying it - I didn't expect that. Again minor thing, because I just need to remember to do But awesome library, keep up the good work! For this PR I wanted to play with it for Polars support, maybe later I'll try other frameworks - should almost work out of the box now (save for the pivot op). Edit: maybe one other thing - I see these warnings: but it doesn't show which codeline it affects, so difficult to debug? I know where I'm adding columns and stuff, but that's in a lot of places. |
Thanks so much for your feedback! 🙏
|
Wow, awesome. I'll have a go at it once released.
Yes, perfect! I think in general what I'd expect (in an ideal world 🙈 - I know this is insanely hard to get perfect) from Narwhals is output equivalence up to DataFrame type (i.e. everything is the same, except the 'container' of the data - e.g. dtypes, row order, column order, column names, precision, nulls, nans, infs, categories are all similar).
👍 |
thanks! it's released, and the fragmentation warning is hopefully addressed too |
Awesome, thanks, I'll have a look at it |
Great work, I don't see the fragmentation messages anymore, and pivot works as expected. Thanks! 👍 |
…Nixtla/hierarchicalforecast into 201-core-add-support-for-polars
Adds support for Polars via Narwhals.
The extension to all frameworks supported under Narwhals should hereafter be (nearly) trivial.
PR isn't breaking (i.e. fully supports existing
NIXTLA_ID_AS_COL
behaviour).Open items
Fixes / better solutions required
Tests
Performance evaluation
Reconcilers seem to run somewhat faster after this PR. Reconciler0 = MinTShrink, Reconciler1 = BottomUp
This PR:
Current main:
Test script for PR in
tests\test_benchmark.py
, run withpytest tests\test_benchmark.py::test_reconciler -v -s --benchmark-min-rounds=20 --disable-warnings