-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 AssertionError
variant to PolarsError
in polars-error
#21460
feat: Add AssertionError
variant to PolarsError
in polars-error
#21460
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #21460 +/- ##
==========================================
+ Coverage 79.94% 79.99% +0.05%
==========================================
Files 1597 1598 +1
Lines 229007 229199 +192
Branches 2620 2620
==========================================
+ Hits 183074 183355 +281
+ Misses 45334 45245 -89
Partials 599 599 ☔ View full report in Codecov by Sentry. |
@@ -408,6 +411,12 @@ on startup."#.trim_start()) | |||
$dtype, | |||
) | |||
}; | |||
(assert_eq = $lhs:expr, $rhs:expr) => { | |||
$crate::polars_err!( | |||
AssertionError: "equality assertion failed: {} != {}", |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This wasn't sufficient. We also need the python data types. See |
Shall I update |
I actually think it is better to map it to the |
If we choose to rely on |
This PR adds support for assertion errors to Polars error handling system. The assertion errors will ultimately be used in Rust when working on migrating
assert_series_equal
andassert_frame_equal
to Rust to facilitate testing. This is the first part (of roughly 3) working on this issue: #21388crates/polars-error/src/lib.rs
:AssertionError
variant toPolarsError
enumAssertionError
to implementation ofDisplay
AssertionError
towrap_msg()
AssertionError
undermacro rules! polars_err
crates/polars-python/src/error.rs
AssertionError
exceptionAssertionError
match
armcrates/polars-python/src/exceptions.rs
AssertionError
tocreate_exception!()