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

fix: Raise error when casting Array to different width #14995

Merged
merged 3 commits into from
Mar 15, 2024
Merged

Conversation

stinodego
Copy link
Member

@stinodego stinodego commented Mar 11, 2024

Closes #15029

You could cast Array types to a different width, resulting in a width that did not match the data.

I also added a fast path for casting List/Array to the same dtype (clone).

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Mar 11, 2024
@stinodego stinodego marked this pull request as ready for review March 11, 2024 19:37
Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 46.15385% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 81.02%. Comparing base (fd9eba2) to head (003e9ac).
Report is 5 commits behind head on main.

Files Patch % Lines
crates/polars-core/src/chunked_array/cast.rs 46.15% 7 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #14995   +/-   ##
=======================================
  Coverage   81.02%   81.02%           
=======================================
  Files        1338     1338           
  Lines      173706   173711    +5     
  Branches     2461     2456    -5     
=======================================
+ Hits       140742   140757   +15     
+ Misses      32494    32487    -7     
+ Partials      470      467    -3     

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

@stinodego stinodego marked this pull request as draft March 12, 2024 14:42
@stinodego stinodego marked this pull request as ready for review March 13, 2024 08:01
@ritchie46 ritchie46 merged commit 4f069f5 into main Mar 15, 2024
23 checks passed
@ritchie46 ritchie46 deleted the list-cast branch March 15, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Casting Array to another Array ignores width changes
2 participants