-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fix parsing corner case closes #19382 #19529
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 #19529 +/- ##
=======================================
Coverage 91.62% 91.62%
=======================================
Files 150 150
Lines 48714 48714
=======================================
Hits 44633 44633
Misses 4081 4081
Continue to review full report at Codecov.
|
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.
pls always always add a whatsnew note for any user facing change.
The conversion code for datetimes is still all over the place because tslib.pyx still exists, would be happy to remove that.
pandas/_libs/tslib.pyx
Outdated
@@ -725,6 +731,21 @@ cpdef array_to_datetime(ndarray[object] values, errors='raise', | |||
return oresult | |||
|
|||
|
|||
cdef bint _handle_error_require_iso8601(object val, int64_t* iresult, |
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 would rather do this inline, you are mutating the result here, and it makes the logic much harder to follow. If you want to do this in a separate PR that just refactors might be ok, but not on this one.
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.
OK.
@@ -15,6 +15,7 @@ | |||
|
|||
from pandas.tseries import offsets | |||
|
|||
from pandas._libs.tslib import OutOfBoundsDatetime |
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.
from pandas.errors import
@@ -1596,6 +1595,19 @@ def test_coerce_of_invalid_datetimes(self): | |||
) | |||
) | |||
|
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.
import from pandas.errors
Yah, I've been holding off on that because there are small differences between array_to_datetime and the Timestamp constructor that I'm hoping to un-difference, then share the implementation. |
thanks. happy to have a cleanup in array_to_datetime, but that's a separate PR |
git diff upstream/master -u -- "*.py" | flake8 --diff