-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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] pandas_compat: fix conversion of datetime series #5547
[FIX] pandas_compat: fix conversion of datetime series #5547
Conversation
25b7a48
to
84ad9e8
Compare
84ad9e8
to
b2c7c75
Compare
54d7414
to
2aa365a
Compare
Codecov Report
@@ Coverage Diff @@
## master #5547 +/- ##
==========================================
- Coverage 86.38% 85.90% -0.48%
==========================================
Files 304 313 +9
Lines 61801 65353 +3552
==========================================
+ Hits 53386 56143 +2757
- Misses 8415 9210 +795 |
if (dt_nonnat.dt.floor("d") == dt_nonnat).all(): | ||
# all times are 00:00:00.0 - pure date | ||
return 1, 0 | ||
elif (dt_nonnat.dt.date == pd.Timestamp("now").date()).all(): |
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.
Does pandas automatically assume today's date if only time is present?
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.
yep. When pd.datetime()
is called on column of times it will be transformed to datetime64 and all dates will be today's dates
6bb5083
to
b177f81
Compare
b177f81
to
4ffed33
Compare
4ffed33
to
672de2f
Compare
Issue
datetime.strftime
and specified formats (e.g. pandas output time on nanosecond precision while DateTime only support reading of milliseconds precision max, and some other cases). It could be solvable via some string manipulation which is heavily error prune.Description of changes
timezone
attribute. Storing utc_offset in TimeVariable is also not a good practice since two dates in the same timezone can have two different offsets depending on summer, wintertime or time zones changes in history. Remembering the timezone is more suitable.Includes