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: Add FunctionCastOptions and conservative IR-level cast type-checking #20286

Merged
merged 7 commits into from
Dec 14, 2024

Conversation

coastalwhite
Copy link
Collaborator

This changes three main things:

  1. Refactor FunctionsOptions::cast_to_supertypes to FunctionOptions::cast_options in preparation for feat: Add index_of() function to Series and Expr #19894.
  2. Immediately prune casts when they are added into the IR through function upcasting
  3. Do some conservative cast type-checking in the IR. For instance, if you try to cast from a Boolean to a DateTime, it is now rejected in the type_coercion stage.

@github-actions github-actions bot added internal An internal refactor or improvement python Related to Python Polars rust Related to Rust Polars labels Dec 13, 2024
Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 80.47619% with 41 lines in your changes missing coverage. Please review.

Project coverage is 79.61%. Comparing base (f599e88) to head (51ad478).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
crates/polars-core/src/datatypes/dtype.rs 35.29% 22 Missing ⚠️
...ars-plan/src/plans/conversion/type_coercion/mod.rs 86.29% 17 Missing ⚠️
...an/src/plans/conversion/type_coercion/functions.rs 80.00% 1 Missing ⚠️
crates/polars-plan/src/plans/options.rs 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20286      +/-   ##
==========================================
+ Coverage   79.59%   79.61%   +0.01%     
==========================================
  Files        1565     1565              
  Lines      218462   218388      -74     
  Branches     2475     2477       +2     
==========================================
- Hits       173885   173860      -25     
+ Misses      44010    43962      -48     
+ Partials      567      566       -1     

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

@ritchie46 ritchie46 merged commit bcca075 into pola-rs:main Dec 14, 2024
20 checks passed
@c-peters c-peters added the accepted Ready for implementation label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation internal An internal refactor or improvement python Related to Python Polars rust Related to Rust Polars
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants