Skip to content

refactor(rust): Move replace_time_zone to polars-core#25680

Open
mcrumiller wants to merge 3 commits intopola-rs:mainfrom
mcrumiller:dt-replace-tz
Open

refactor(rust): Move replace_time_zone to polars-core#25680
mcrumiller wants to merge 3 commits intopola-rs:mainfrom
mcrumiller:dt-replace-tz

Conversation

@mcrumiller
Copy link
Copy Markdown
Contributor

@mcrumiller mcrumiller commented Dec 8, 2025

This is needed to resolve #25674.


In order to fix #25674, we must update the cast from datetime to date, and replace_time_zone, which currently resides in the polars_ops crate, needs to be accessible from the cast function. Once this is in, the fix for that issue will be fairly trivial (add replace_time_zone to the cast).

There are no logical changes, this PR makes replace_time_zone a proper method of DatetimeChunked.

@github-actions github-actions Bot added internal An internal refactor or improvement python Related to Python Polars rust Related to Rust Polars labels Dec 8, 2025
@mcrumiller mcrumiller marked this pull request as ready for review December 8, 2025 16:58
@mcrumiller mcrumiller changed the title refactor: Move replace_time_zone to polars-core refactor(rust): Move replace_time_zone to polars-core Dec 8, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 8, 2025

Codecov Report

❌ Patch coverage is 98.13953% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.73%. Comparing base (cb992fc) to head (27147a7).

Files with missing lines Patch % Lines
crates/polars-expr/src/dispatch/datetime.rs 92.10% 3 Missing ⚠️
crates/polars-expr/src/dispatch/temporal.rs 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #25680      +/-   ##
==========================================
- Coverage   80.50%   79.73%   -0.77%     
==========================================
  Files        1771     1770       -1     
  Lines      243327   243326       -1     
  Branches     3037     3037              
==========================================
- Hits       195883   194017    -1866     
- Misses      46662    48527    +1865     
  Partials      782      782              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement python Related to Python Polars rust Related to Rust Polars

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cast from Datetime with time zone to Date changes date

1 participant