-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: read_json converted date strings with Z to UTC #26170
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
Codecov Report
@@ Coverage Diff @@
## master #26170 +/- ##
==========================================
- Coverage 91.98% 91.98% -0.01%
==========================================
Files 175 175
Lines 52377 52384 +7
==========================================
+ Hits 48180 48184 +4
- Misses 4197 4200 +3
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #26170 +/- ##
==========================================
- Coverage 91.98% 90.53% -1.46%
==========================================
Files 175 175
Lines 52384 52388 +4
==========================================
- Hits 48184 47428 -756
- Misses 4200 4960 +760
Continue to review full report at Codecov.
|
try: | ||
result = result.tz_localize('UTC').tz_convert(tz_parsed) | ||
except AttributeError: | ||
# Regular Index from 'ignore' path |
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 could this ever be hit as you are constructing a DTI here?
further should not all of the localization only be on this path (e.g. you must have a DTI); the way its written you could be an Index? (which is not possible)
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.
Above there's
if errors == 'ignore':
from pandas import Index
result = Index(result, name=name)
Where this could be an Index
if there were actually errors or coerced to DatetimeIndex
if there were no errors.
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.
right so what hits that? meaning if it is not coerced, then we can never attempt the localization no matter what
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.
Yeah if it's not coerced to DatetimeIndex
we're just returning the result (Index
). array_with_unit_to_datetime
above could return an object array that wouldn't get coerced to DatetimeIndex
lgtm. can you merge master; ping on green. |
Thanks @mroeschke |
git diff upstream/master -u -- "*.py" | flake8 --diff