Skip to content
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

refactor(rust): Map Polars AssertionError to pyo3's AssertionError and improve macro flexibility #21495

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

Kevin-Patyk
Copy link
Contributor

@Kevin-Patyk Kevin-Patyk commented Feb 27, 2025

This PR is regarding comments from @coastalwhite on this PR: #21460 and from Discord regarding using pyo3's built in AssertionError and using the macro for more general assertions.

Previous PR relates to issue: #21388.

  • In polars-error/lib.rs, the macro has been updated to be more generalize and also match the already existing Python assertion error.
  • In error.rs, PolarsError::AssertionError has been mapped to PyAssertionError rather than making a new exception.
  • In exceptions.rs, the create_exception_macro!() has been removed for AssertionError since it will be relying on pyo3's existing implementation.

@Kevin-Patyk Kevin-Patyk changed the title refactor(rust): Map Polars AssertionError to pyo3's AssertionError and improve macro flexibility refactor(rust): Map Polars AssertionError to pyo3's AssertionError and improve macro flexibility Feb 27, 2025
@github-actions github-actions bot added internal An internal refactor or improvement rust Related to Rust Polars and removed title needs formatting labels Feb 27, 2025
Copy link

codecov bot commented Feb 27, 2025

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 79.98%. Comparing base (5e280d9) to head (6618427).
Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
crates/polars-python/src/error.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #21495   +/-   ##
=======================================
  Coverage   79.98%   79.98%           
=======================================
  Files        1598     1598           
  Lines      229320   229321    +1     
  Branches     2623     2623           
=======================================
+ Hits       183412   183421    +9     
+ Misses      45303    45295    -8     
  Partials      605      605           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ritchie46 ritchie46 merged commit 7360d15 into pola-rs:main Feb 28, 2025
25 of 26 checks passed
anath2 pushed a commit to anath2/polars that referenced this pull request Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants