Skip to content

Commit 8590bd5

Browse files
authored
CLN: unused imports in tslibs (#35133)
1 parent 8f29758 commit 8590bd5

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

pandas/_libs/tslibs/offsets.pyx

+1-15
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ from pandas._libs.tslibs.timezones cimport utc_pytz as UTC
5151
from pandas._libs.tslibs.tzconversion cimport tz_convert_single
5252

5353
from .dtypes cimport PeriodDtypeCode
54-
from .fields import get_start_end_field
5554
from .timedeltas cimport delta_to_nanoseconds
5655
from .timedeltas import Timedelta
5756
from .timestamps cimport _Timestamp
@@ -99,12 +98,6 @@ def apply_index_wraps(func):
9998
# do @functools.wraps(func) manually since it doesn't work on cdef funcs
10099
wrapper.__name__ = func.__name__
101100
wrapper.__doc__ = func.__doc__
102-
try:
103-
wrapper.__module__ = func.__module__
104-
except AttributeError:
105-
# AttributeError: 'method_descriptor' object has no
106-
# attribute '__module__'
107-
pass
108101
return wrapper
109102

110103

@@ -159,12 +152,6 @@ def apply_wraps(func):
159152
# do @functools.wraps(func) manually since it doesn't work on cdef funcs
160153
wrapper.__name__ = func.__name__
161154
wrapper.__doc__ = func.__doc__
162-
try:
163-
wrapper.__module__ = func.__module__
164-
except AttributeError:
165-
# AttributeError: 'method_descriptor' object has no
166-
# attribute '__module__'
167-
pass
168155
return wrapper
169156

170157

@@ -355,8 +342,7 @@ class ApplyTypeError(TypeError):
355342

356343
cdef class BaseOffset:
357344
"""
358-
Base class for DateOffset methods that are not overridden by subclasses
359-
and will (after pickle errors are resolved) go into a cdef class.
345+
Base class for DateOffset methods that are not overridden by subclasses.
360346
"""
361347
_day_opt = None
362348
_attributes = tuple(["n", "normalize"])

pandas/_libs/tslibs/timestamps.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ from numpy cimport int64_t, int8_t, uint8_t, ndarray
1414
cnp.import_array()
1515

1616
from cpython.object cimport (PyObject_RichCompareBool, PyObject_RichCompare,
17-
Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE)
17+
Py_EQ, Py_NE)
1818

1919
from cpython.datetime cimport (
2020
datetime,
@@ -51,7 +51,7 @@ from pandas._libs.tslibs.np_datetime cimport (
5151
pydatetime_to_dt64,
5252
)
5353
from pandas._libs.tslibs.np_datetime import OutOfBoundsDatetime
54-
from pandas._libs.tslibs.offsets cimport to_offset, is_tick_object, is_offset_object
54+
from pandas._libs.tslibs.offsets cimport to_offset, is_offset_object
5555
from pandas._libs.tslibs.timedeltas cimport is_any_td_scalar, delta_to_nanoseconds
5656
from pandas._libs.tslibs.timedeltas import Timedelta
5757
from pandas._libs.tslibs.timezones cimport (

0 commit comments

Comments
 (0)