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: Interpret %y consistently with Chrono in to_date/to_datetime/strptime #17661

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

MarcoGorelli
Copy link
Collaborator

@MarcoGorelli MarcoGorelli commented Jul 16, 2024

closes #17213

Personally I don't think the cutoff should be configurable (for a start, Chrono doesn't make it configurable, so there'd be no way to control what happens when the Chrono parser is used)

The Polars docs already point to the Chrono docs, so I think that's sufficient (I've also made a PR to chrono to note the cutoff in their docs chronotope/chrono#1598)

This is one of those borderline bugfix / breaking changes that I think would be better suited to 1.2 than to 1.1.1. At the same time, I don't think it's significant enough that it warrants waiting until 2.0

@MarcoGorelli MarcoGorelli changed the title fix: interpret %y consistently with Chrono in to_date/to_datetime/strptime fix: Interpret %y consistently with Chrono in to_date/to_datetime/strptime Jul 16, 2024
@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars and removed title needs formatting labels Jul 16, 2024
@MarcoGorelli MarcoGorelli marked this pull request as ready for review July 16, 2024 10:54
@MarcoGorelli MarcoGorelli changed the title fix: Interpret %y consistently with Chrono in to_date/to_datetime/strptime fix!: Interpret %y consistently with Chrono in to_date/to_datetime/strptime Jul 16, 2024
@github-actions github-actions bot added the breaking Change that breaks backwards compatibility label Jul 16, 2024
Copy link

codecov bot commented Jul 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.71%. Comparing base (08b6f1d) to head (b2e5b83).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17661      +/-   ##
==========================================
- Coverage   80.72%   80.71%   -0.01%     
==========================================
  Files        1485     1485              
  Lines      195527   195527              
  Branches     2782     2782              
==========================================
- Hits       157839   157821      -18     
- Misses      37176    37194      +18     
  Partials      512      512              

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

@ritchie46 ritchie46 changed the title fix!: Interpret %y consistently with Chrono in to_date/to_datetime/strptime fix: Interpret %y consistently with Chrono in to_date/to_datetime/strptime Jul 16, 2024
@ritchie46 ritchie46 removed the breaking Change that breaks backwards compatibility label Jul 16, 2024
@ritchie46 ritchie46 merged commit 3897a37 into pola-rs:main Jul 16, 2024
30 of 31 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.

Ability to control the assumed century cutoff with Expr.str.to_date when parsing 2-digit years
2 participants