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: Catch use of 'polars' in to_string for non-Duration dtypes and raise an informative error #19977

Merged

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Nov 25, 2024

Closes #19970.

Makes sense to add a simple dtype check for use of expr.dt.to_string("polars") with non-Duration dtypes as it is a special-case.

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars labels Nov 25, 2024
@ritchie46 ritchie46 merged commit 9e2e311 into pola-rs:main Nov 25, 2024
28 checks passed
@alexander-beedie alexander-beedie deleted the to-string-temporal-error-check branch November 25, 2024 14:53
Copy link

codecov bot commented Nov 25, 2024

Codecov Report

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

Project coverage is 79.48%. Comparing base (fdf9751) to head (8921070).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...lars-core/src/chunked_array/temporal/conversion.rs 68.18% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #19977      +/-   ##
==========================================
- Coverage   79.49%   79.48%   -0.01%     
==========================================
  Files        1555     1556       +1     
  Lines      216377   216397      +20     
  Branches     2456     2456              
==========================================
+ Hits       172002   172006       +4     
- Misses      43817    43833      +16     
  Partials      558      558              

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


🚨 Try these New Features:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

to_string shouldn't accepct polars format expect for Duration
2 participants