-
-
Notifications
You must be signed in to change notification settings - Fork 18.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
BUG: DatetimeTZBlock can't assign values near dst boundary #14146
Conversation
@@ -1038,7 +1038,7 @@ def test_fillna_series_datetime64tz(self): | |||
# datetime64tz + int => datetime64tz | |||
# ToDo: must be object | |||
exp = pd.Series([pd.Timestamp('2011-01-01', tz=tz), | |||
pd.Timestamp(1).tz_localize(tz=tz), | |||
pd.Timestamp(1, tz=tz), |
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.
Both cases are incorrect. Being fixed by #14145.
Current coverage is 85.24% (diff: 100%)@@ master #14146 diff @@
==========================================
Files 140 140
Lines 50556 50556
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 43095 43095
Misses 7461 7461
Partials 0 0
|
@@ -2314,7 +2317,10 @@ def __init__(self, values, placement, ndim=2, **kwargs): | |||
if dtype is not None: | |||
if isinstance(dtype, compat.string_types): | |||
dtype = DatetimeTZDtype.construct_from_string(dtype) | |||
values = values.tz_localize('UTC').tz_convert(dtype.tz) | |||
|
|||
if isinstance(values, DatetimeTZBlock): |
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.
how is this ever hit?
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.
Looks never, it was needed for initial trial. Removed.
@sinhrks just that question from above. |
ae76d87
to
95aa6b5
Compare
thanks! |
git diff upstream/master | flake8 --diff
Value assignment doesn't work if data contains DST boundary because of internal
.localize(None)
.