Skip to content

feat: Extract timezone info from python datetimes#20822

Merged
ritchie46 merged 5 commits intopola-rs:mainfrom
bschoenmaeckers:python-datetime-timezone
Jan 28, 2025
Merged

feat: Extract timezone info from python datetimes#20822
ritchie46 merged 5 commits intopola-rs:mainfrom
bschoenmaeckers:python-datetime-timezone

Conversation

@bschoenmaeckers
Copy link
Copy Markdown
Contributor

@bschoenmaeckers bschoenmaeckers commented Jan 21, 2025

We now extract the timezone from python as of #20660 (comment). It is however not yet clear to me when we have to infer the local timezone because all tests currently pass.

fixes #20766
closes #19509

@bschoenmaeckers bschoenmaeckers changed the title feat: extract timezone info from python datetimes feat: Extract timezone info from python datetimes Jan 21, 2025
@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 and removed title needs formatting labels Jan 21, 2025
@bschoenmaeckers bschoenmaeckers force-pushed the python-datetime-timezone branch from f33c0a8 to 837df0c Compare January 21, 2025 12:34
@bschoenmaeckers
Copy link
Copy Markdown
Contributor Author

... all tests currently pass.

Apparently not on python 3.9

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 21, 2025

Codecov Report

Attention: Patch coverage is 95.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 79.29%. Comparing base (dadad0d) to head (5296768).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
py-polars/polars/_utils/construction/utils.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #20822   +/-   ##
=======================================
  Coverage   79.28%   79.29%           
=======================================
  Files        1578     1578           
  Lines      224195   224200    +5     
  Branches     2576     2573    -3     
=======================================
+ Hits       177756   177780   +24     
+ Misses      45848    45832   -16     
+ Partials      591      588    -3     

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

@bschoenmaeckers
Copy link
Copy Markdown
Contributor Author

The amount of timezone related issues showed me where the "infer" part needs to be. I will investigate which issues are relevant to this and add tests accordingly.

@bschoenmaeckers bschoenmaeckers force-pushed the python-datetime-timezone branch 4 times, most recently from a242bd7 to e8842e9 Compare January 22, 2025 17:20
@bschoenmaeckers
Copy link
Copy Markdown
Contributor Author

Probably fixes #20544 and #19268 as well. Will add tests later.

I can pickup #20264 as well when I'm still on it.

@bschoenmaeckers bschoenmaeckers force-pushed the python-datetime-timezone branch from e8842e9 to 161bc95 Compare January 23, 2025 08:14
@ritchie46 ritchie46 force-pushed the python-datetime-timezone branch from 161bc95 to 5296768 Compare January 28, 2025 10:47
@ritchie46
Copy link
Copy Markdown
Member

Thank you @bschoenmaeckers. 👍

@ritchie46 ritchie46 merged commit cb8a7ca into pola-rs:main Jan 28, 2025
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

2 participants