Skip to content

CLN: unused imports in tslibs #35133

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

Merged
merged 1 commit into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions pandas/_libs/tslibs/offsets.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ from pandas._libs.tslibs.timezones cimport utc_pytz as UTC
from pandas._libs.tslibs.tzconversion cimport tz_convert_single

from .dtypes cimport PeriodDtypeCode
from .fields import get_start_end_field
from .timedeltas cimport delta_to_nanoseconds
from .timedeltas import Timedelta
from .timestamps cimport _Timestamp
Expand Down Expand Up @@ -99,12 +98,6 @@ def apply_index_wraps(func):
# do @functools.wraps(func) manually since it doesn't work on cdef funcs
wrapper.__name__ = func.__name__
wrapper.__doc__ = func.__doc__
try:
wrapper.__module__ = func.__module__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for removing this? I think module is still part of the python data model

https://docs.python.org/3/reference/datamodel.html

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This try never succeeds

except AttributeError:
# AttributeError: 'method_descriptor' object has no
# attribute '__module__'
pass
return wrapper


Expand Down Expand Up @@ -159,12 +152,6 @@ def apply_wraps(func):
# do @functools.wraps(func) manually since it doesn't work on cdef funcs
wrapper.__name__ = func.__name__
wrapper.__doc__ = func.__doc__
try:
wrapper.__module__ = func.__module__
except AttributeError:
# AttributeError: 'method_descriptor' object has no
# attribute '__module__'
pass
return wrapper


Expand Down Expand Up @@ -355,8 +342,7 @@ class ApplyTypeError(TypeError):

cdef class BaseOffset:
"""
Base class for DateOffset methods that are not overridden by subclasses
and will (after pickle errors are resolved) go into a cdef class.
Base class for DateOffset methods that are not overridden by subclasses.
"""
_day_opt = None
_attributes = tuple(["n", "normalize"])
Expand Down
4 changes: 2 additions & 2 deletions pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ from numpy cimport int64_t, int8_t, uint8_t, ndarray
cnp.import_array()

from cpython.object cimport (PyObject_RichCompareBool, PyObject_RichCompare,
Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE)
Py_EQ, Py_NE)

from cpython.datetime cimport (
datetime,
Expand Down Expand Up @@ -51,7 +51,7 @@ from pandas._libs.tslibs.np_datetime cimport (
pydatetime_to_dt64,
)
from pandas._libs.tslibs.np_datetime import OutOfBoundsDatetime
from pandas._libs.tslibs.offsets cimport to_offset, is_tick_object, is_offset_object
from pandas._libs.tslibs.offsets cimport to_offset, is_offset_object
from pandas._libs.tslibs.timedeltas cimport is_any_td_scalar, delta_to_nanoseconds
from pandas._libs.tslibs.timedeltas import Timedelta
from pandas._libs.tslibs.timezones cimport (
Expand Down