-
Notifications
You must be signed in to change notification settings - Fork 124
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: catch Polars exceptions, unify exception raising more #1918
base: main
Are you sure you want to change the base?
Conversation
The only tests failures are from Marimo, where they're checking the Polars error very tightly in their tests
|
Hey @mscolnick , I just wanted to run this past you There's been requests to unify the exceptions from Narwhals. We do that somewhat already, but this PR makes another step towards that. As far as I can't, there'd be no user-facing impact, it would just be matter of updating the expected exception in 2 tests from the Marimo test suite. I'd be happy to make a PR if welcome Would you be OK with this change? Else no worries, we could always just preserve the current exceptions in the v1 API, I just figured that for something so small it might not be worth it |
Yea that is fine with us and would appreciate the help with the change, thank you! |
@MarcoGorelli I'd be careful with how this impacts performance, since we only get zero-cost exceptions on >=3.11 Somewhat related: |
Thanks Dan! I'll do some checks before shipping it - I think it shouldn't be an issue because it's only on Dataframe methods, e.g. for
the try-except would only happen when Nonetheless, I would like to time it and be careful with it, so this'll stay out of today's release, we can revisit for the next one when we've done more careful checks |
Unify exceptions, and re-raise Polars ones as Narwhals ones
This doesn't unify everything...but I think it's a nice step forwards, and should be
totally backwards-compatiblemostly backwards-compatible (unless anyone catches Polars exceptions specifically in tests)Towards #1373