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

feat(python)!: Rename ModuleUpgradeRequired and PolarsPanicError error, remove InvalidAssert error #17033

Merged
merged 11 commits into from
Jun 18, 2024

Conversation

stinodego
Copy link
Member

@stinodego stinodego commented Jun 17, 2024

Changes

  • Rename PolarsPanicError to PanicException. We are just re-exporting PyO3's PanicException, so the user sees pyo3_runtime.PanicException: .... Re-exporting under a different name just causes confusion.
  • Rename ModuleUpgradeRequired to ModuleUpgradeRequiredError. This is to satisfy naming conventions (errors should end in Error).
  • Remove InvalidAssert error. It was used in 1 place (testing utils) and not really necessary. A TypeError should suffice here.
  • Change an error for unsortable types from ComputeError to InvalidOperationError.
  • Update definition of PolarsError and PolarsWarning so that the display matches the name (previously would show PolarsBaseError/PolarsBaseWarning).

I also considered removing the PanicException re-export altogether and making users write a bare except:, since panics are not really intended to be handled... open to feedback on this one.

@github-actions github-actions bot added breaking Change that breaks backwards compatibility internal An internal refactor or improvement python Related to Python Polars labels Jun 17, 2024
@stinodego stinodego marked this pull request as ready for review June 17, 2024 22:48
Copy link

codecov bot commented Jun 17, 2024

Codecov Report

Attention: Patch coverage is 83.14607% with 15 lines in your changes missing coverage. Please review.

Project coverage is 80.97%. Comparing base (8a410ca) to head (1dcdfee).

Files Patch % Lines
py-polars/polars/dataframe/frame.py 0.00% 7 Missing ⚠️
py-polars/polars/series/series.py 25.00% 3 Missing ⚠️
py-polars/polars/io/spreadsheet/functions.py 0.00% 2 Missing ⚠️
py-polars/polars/dependencies.py 50.00% 1 Missing ⚠️
py-polars/polars/io/database/_executor.py 50.00% 1 Missing ⚠️
py-polars/src/map/mod.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17033      +/-   ##
==========================================
+ Coverage   80.95%   80.97%   +0.01%     
==========================================
  Files        1448     1448              
  Lines      190554   190586      +32     
  Branches     2723     2723              
==========================================
+ Hits       154265   154323      +58     
+ Misses      35786    35759      -27     
- Partials      503      504       +1     

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

@stinodego stinodego marked this pull request as draft June 17, 2024 23:26
@stinodego stinodego changed the title refactor(python)!: Remove InvalidAssert error and rename ModuleUpgradeRequired error refactor(python)!: Rename ModuleUpgradeRequired error and remove InvalidAssert error Jun 18, 2024
@stinodego stinodego changed the title refactor(python)!: Rename ModuleUpgradeRequired error and remove InvalidAssert error refactor(python)!: Rename ModuleUpgradeRequired and PolarsPanicError error, remove InvalidAssert error Jun 18, 2024
@stinodego stinodego changed the title refactor(python)!: Rename ModuleUpgradeRequired and PolarsPanicError error, remove InvalidAssert error feat(python)!: Rename ModuleUpgradeRequired and PolarsPanicError error, remove InvalidAssert error Jun 18, 2024
@stinodego stinodego removed the internal An internal refactor or improvement label Jun 18, 2024
@github-actions github-actions bot added the enhancement New feature or an improvement of an existing feature label Jun 18, 2024
@stinodego stinodego marked this pull request as ready for review June 18, 2024 09:22
@stinodego stinodego added this to the 1.0.0 milestone Jun 18, 2024
@ritchie46 ritchie46 merged commit 7e19e04 into main Jun 18, 2024
33 checks passed
@ritchie46 ritchie46 deleted the rename-errors branch June 18, 2024 10:43
@c-peters c-peters added the accepted Ready for implementation label Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation breaking Change that breaks backwards compatibility enhancement New feature or an improvement of an existing feature python Related to Python Polars
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants