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)!: Update a lot of error types #10637

Merged
merged 2 commits into from
Aug 21, 2023
Merged

feat(python)!: Update a lot of error types #10637

merged 2 commits into from
Aug 21, 2023

Conversation

stinodego
Copy link
Member

@stinodego stinodego commented Aug 20, 2023

Related to #10421

Changes

  • Many ValueErrors were changed to TypeErrors.
  • Some ImportErrors were changed to ModuleNotFoundErrors (a subclass of ImportError).
  • Some error message cleanup

Error types reference:
https://docs.python.org/3/library/exceptions.html
https://www.tutorialsteacher.com/python/error-types-in-python

Example

Before:

pl.Series(values=15)
# ValueError: Series constructor called with unsupported type; got 'int'

After:

pl.Series(values=15)
# TypeError: Series constructor called with unsupported type 'int' for the `values` parameter

@github-actions github-actions bot added fix Bug fix python Related to Python Polars labels Aug 20, 2023
@stinodego stinodego changed the title fix(python): Update a lot of error types fix(python)!: Update a lot of error types Aug 21, 2023
@github-actions github-actions bot added the breaking Change that breaks backwards compatibility label Aug 21, 2023
@stinodego stinodego force-pushed the update-error-types branch 2 times, most recently from e228481 to bdc85f1 Compare August 21, 2023 07:41
@stinodego stinodego marked this pull request as ready for review August 21, 2023 07:47
@stinodego stinodego added this to the 0.19 milestone Aug 21, 2023
@stinodego stinodego changed the title fix(python)!: Update a lot of error types feat(python)!: Update a lot of error types Aug 21, 2023
@stinodego stinodego removed the fix Bug fix label Aug 21, 2023
@github-actions github-actions bot added the enhancement New feature or an improvement of an existing feature label Aug 21, 2023
@alexander-beedie
Copy link
Collaborator

Epic :)

@stinodego stinodego merged commit 6f50321 into main Aug 21, 2023
14 checks passed
@stinodego stinodego deleted the update-error-types branch August 21, 2023 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Change that breaks backwards compatibility enhancement New feature or an improvement of an existing feature python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants