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(rust, python): let cast_time_zone work on tz-naive and deprecate tz-localize #6649

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

MarcoGorelli
Copy link
Collaborator

@MarcoGorelli MarcoGorelli commented Feb 3, 2023

closes #6561

@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 Feb 3, 2023
@ritchie46
Copy link
Member

Nice, that will reduce confusion!

@sm-Fifteen
Copy link

Nice, that will reduce confusion!

@ritchie46: I'm confused, wasn't tz_localize specifically introduced a few months ago because the behavior between naïve date-times and tz-aware timestamps was confusing between with_time_zone and cast_time_zone?

Shouldn't we just put timestamps (aware) and datetimes (naïve) in separate namespaces at this point?

@MarcoGorelli
Copy link
Collaborator Author

In #6338 (comment) he said

The tz_localize was introduced when I still had bugs in the cast_* and with_*, those have been resolved and the conversion now is predictable (AFAICT).

The behaviour will now be simple and predictable:

  • cast_time_zone: set/unset/change time zone
  • with_time_zone: convert from one time zone to another

Vincenthays pushed a commit to Vincenthays/polars that referenced this pull request Feb 9, 2023
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.

Deprecate tz_localize, let cast_timezone work on naive
3 participants