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!: Change casting failures from ComputeError to InvalidOperationError #16895

Merged
merged 2 commits into from
Jun 12, 2024

Conversation

stinodego
Copy link
Member

@stinodego stinodego commented Jun 12, 2024

A lot of casting failures were already InvalidOperationError. Now a whole bunch of others are as well.

Skipping in the changelog in favor of #15030

Example

Before:

>>> s = pl.Series("a", [100, 200, 300])
>>> s.cast(pl.UInt8)
Traceback (most recent call last):
...
polars.exceptions.ComputeError: conversion from `i64` to `u8` failed in column 'a' for 1 out of 3 values: [300]

After:

>>> s.cast(pl.UInt8)
Traceback (most recent call last):
...
polars.exceptions.InvalidOperationError: conversion from `i64` to `u8` failed in column 'a' for 1 out of 3 values: [300]

@github-actions github-actions bot added breaking Change that breaks backwards compatibility enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars labels Jun 12, 2024
@stinodego stinodego marked this pull request as ready for review June 12, 2024 09:49
Copy link

codecov bot commented Jun 12, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 81.42%. Comparing base (f7cca90) to head (cc2ff0b).

Files Patch % Lines
...rc/logical_plan/conversion/type_coercion/binary.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16895      +/-   ##
==========================================
- Coverage   81.43%   81.42%   -0.01%     
==========================================
  Files        1425     1425              
  Lines      187973   187973              
  Branches     2704     2704              
==========================================
- Hits       153074   153058      -16     
- Misses      34402    34418      +16     
  Partials      497      497              

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

@ritchie46 ritchie46 merged commit cd68100 into main Jun 12, 2024
27 checks passed
@ritchie46 ritchie46 deleted the cast-error-type branch June 12, 2024 14:07
@stinodego stinodego added the skip changelog Do not include in changelog label Jun 12, 2024
@c-peters c-peters added the accepted Ready for implementation label Jun 16, 2024
Wouittone pushed a commit to Wouittone/polars that referenced this pull request Jun 22, 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 rust Related to Rust Polars skip changelog Do not include in changelog
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants