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: to_any_value should supports all LiteralValue type #15387

Merged
merged 3 commits into from
Mar 31, 2024

Conversation

reswqa
Copy link
Collaborator

@reswqa reswqa commented Mar 29, 2024

This fixes #15379.

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Mar 29, 2024
Copy link

codecov bot commented Mar 29, 2024

Codecov Report

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

Project coverage is 81.25%. Comparing base (3785fad) to head (8c62de4).
Report is 26 commits behind head on main.

Files Patch % Lines
crates/polars-plan/src/logical_plan/lit.rs 7.69% 24 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15387      +/-   ##
==========================================
- Coverage   81.41%   81.25%   -0.17%     
==========================================
  Files        1362     1361       -1     
  Lines      176734   174738    -1996     
  Branches     2531     2531              
==========================================
- Hits       143896   141985    -1911     
+ Misses      32354    32269      -85     
  Partials      484      484              

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

@reswqa reswqa marked this pull request as ready for review March 29, 2024 08:12
Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should instead implement to_any_value for the missing types. Should be easy enough - Series and Range become a List type AnyValue, and Binary becomes a Binary AnyValue.

@reswqa
Copy link
Collaborator Author

reswqa commented Mar 29, 2024

Series and Range become a List type AnyValue.

Emm, that's what I thought at first, but I wasn't sure whether this conversion is clear in all cases or not? Because to_any_value is called in more than one place.

But I have updated this anyway, let's see if CI is broken then. :)

@reswqa reswqa changed the title fix: pl.repeat raise instead of panic if dtype can't be inferred fix: to_any_value should supports all LiteralValue type Mar 29, 2024
Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Nice that we can use repeat on list inputs now 👌

Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Nice that we can use repeat on list inputs now 👌

@reswqa
Copy link
Collaborator Author

reswqa commented Mar 31, 2024

Thanks @stinodego, do you think I can click the merge button atm? 😉

@ritchie46 ritchie46 merged commit ab5c0ee into pola-rs:main Mar 31, 2024
23 checks passed
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.

pl.repeat() panicks if input doesn't match data type
3 participants