-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
BUG #34621 added nanosecond support to class Period #34720
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
Changes from 1 commit
91a7c7e
73a6eab
ea9f69c
ab5640f
95d740e
abb0936
8a559cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,6 @@ from pandas._libs.tslibs.np_datetime cimport ( | |
NPY_FR_D, | ||
NPY_FR_us, | ||
) | ||
from pandas._libs.tslibs.np_datetime import OutOfBoundsDatetime | ||
|
||
cdef extern from "src/datetime/np_datetime.h": | ||
int64_t npy_datetimestruct_to_datetime(NPY_DATETIMEUNIT fr, | ||
|
@@ -2408,11 +2407,12 @@ class Period(_Period): | |
dt, reso = parse_time_string(value, freq) | ||
try: | ||
ts = Timestamp(value) | ||
except ValueError: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we end up parsing this twice which is not good, yeah i think this needs to be integrated a bit more to i guess the currently soln would be ok in the interim, but would need to run asv's on all periods to see what kind of perf hit here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far I read, nanosecond was not accepted into dateutil module. This interim solution could stand for a while. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
we don't wait for dateutil in this, as it will not likey every support nanosecond because the standard library does not |
||
nanosecond = 0 | ||
else: | ||
nanosecond = ts.nanosecond | ||
jreback marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if nanosecond != 0: | ||
reso = 'nanosecond' | ||
except ValueError: | ||
nanosecond = 0 | ||
if dt is NaT: | ||
ordinal = NPY_NAT | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.