-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN: circular/runtime imports in tslibs #34563
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 all commits
20ee619
e3a1b68
f4f2163
bac57a2
742ebe8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,6 @@ from pandas._libs.tslibs.ccalendar cimport DAY_NANOS, HOUR_NANOS | |
from pandas._libs.tslibs.nattype cimport NPY_NAT | ||
from pandas._libs.tslibs.np_datetime cimport ( | ||
npy_datetimestruct, dt64_to_dtstruct) | ||
from pandas._libs.tslibs.timedeltas cimport delta_to_nanoseconds | ||
from pandas._libs.tslibs.timezones cimport ( | ||
get_dst_info, is_tzlocal, is_utc, get_timezone, get_utcoffset) | ||
|
||
|
@@ -123,6 +122,7 @@ timedelta-like} | |
elif nonexistent == 'shift_backward': | ||
shift_backward = True | ||
elif PyDelta_Check(nonexistent): | ||
from .timedeltas import delta_to_nanoseconds | ||
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. does it make sense to move delta_to_nanoseconds even higher eg to base.pyx ? 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. ive considered this and gotten hung up on attribute lookup behavior which isnt doing optimizations that i think it should. I'd like to punt on this for now until I get that sorted out. |
||
shift_delta = delta_to_nanoseconds(nonexistent) | ||
elif nonexistent not in ('raise', None): | ||
msg = ("nonexistent must be one of {'NaT', 'raise', 'shift_forward', " | ||
|
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.
are we consisten about relative imports? I really don't like mixing this.
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're not, but the above line is relative so i figured this should be too since its the same module.
while we generally do absolute, i think we should move to relative for tslibs since self-containment is a big deal here