-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Right result for DatetimeIndex + TimeDelta when timezone is set(… #13935
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
Conversation
@@ -461,7 +461,7 @@ def _convert_to_array(self, values, name=None, other=None): | |||
|
|||
# a datelike | |||
elif isinstance(values, pd.DatetimeIndex): | |||
values = values.to_series() |
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.
we should handle is_datetime64_dtype
and is_datetime64tz_dtype
separately here
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.
it happens, isn't is?
Current coverage is 85.30% (diff: 100%)@@ master #13935 diff @@
==========================================
Files 139 139
Lines 50157 50161 +4
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 42785 42790 +5
+ Misses 7372 7371 -1
Partials 0 0
|
@@ -543,9 +543,9 @@ def _offset(lvalues, rvalues): | |||
|
|||
# with tz, convert to UTC | |||
if self.is_datetime64tz_lhs: | |||
lvalues = lvalues.tz_localize(None) |
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.
I think this localization can be removed, as adding timedelta is unrelated to the timezone.
Pls add a test for |
acutally need to localize if freq < 1D, otherwise can simply add it. E.g. if we are crossing a dst boundary, then need to convert to UTC, operate, then re-convert. So I think we should continue to always convert / operate / re-convert for simplicity. |
@jreback you're right, but |
5150db3
to
b17da31
Compare
can you rebase / update? |
can you rebase / update |
1 similar comment
can you rebase / update |
closing, but if you want to update, pls comment |
git diff upstream/master | flake8 --diff
…#13905)