-
Notifications
You must be signed in to change notification settings - Fork 8
feat: Add time_zone
to Datetime
result
s
#33
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
base: main
Are you sure you want to change the base?
feat: Add time_zone
to Datetime
result
s
#33
Conversation
allows setting a time zone for datetimes and checking if the values in the column matches it
time_zone
to Datetime
result
stime_zone
to Datetime
result
s
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #33 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 38 38
Lines 1845 1850 +5
=========================================
+ Hits 1845 1850 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the nice PR @dfrankland! Could you add a test in test_sql_schema.py
for the oracle part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the initiative @dfrankland, I think this is a very useful addition! :)
time_zone
to Datetime
result
stime_zone
to Datetime
result
s
Let me know if you'd like for me to rebase these changes |
8de8c8f
to
30e3538
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All right, nice, I think we're almost there! :)
Updated to keep things minimal and also made the test name more accurate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the updates! Just one tiny comment left :)
return pa.timestamp("us") | ||
time_zone = ( | ||
self.time_zone.tzname(None) | ||
if isinstance(self.time_zone, dt.timezone) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this mirror the type annotation? 😄
if isinstance(self.time_zone, dt.timezone) | |
if isinstance(self.time_zone, dt.tzinfo) |
from dataframely._compat import ( | ||
pa, | ||
sa, | ||
sa_mssql, | ||
sa_TypeEngine, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing changed here, right?
from dataframely._compat import ( | |
pa, | |
sa, | |
sa_mssql, | |
sa_TypeEngine, | |
) | |
from dataframely._compat import pa, sa, sa_mssql, sa_TypeEngine |
Motivation
Closes #32
Changes
allows setting a time zone for datetimes and checking if the values in the column matches it
Pertinent polars docs:
https://docs.pola.rs/user-guide/transformations/time-series/timezones/