Skip to content

Commit 9e67f43

Browse files
jbrockmendeljreback
authored andcommitted
Remove unused imports (#17745)
1 parent 8e89cb3 commit 9e67f43

File tree

4 files changed

+4
-28
lines changed

4 files changed

+4
-28
lines changed

pandas/_libs/hashtable.pyx

-6
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ cnp.import_ufunc()
5050
cdef int64_t iNaT = util.get_nat()
5151
_SIZE_HINT_LIMIT = (1 << 20) + 7
5252

53-
cdef extern from "datetime.h":
54-
bint PyDateTime_Check(object o)
55-
void PyDateTime_IMPORT()
56-
57-
PyDateTime_IMPORT
58-
5953

6054
cdef size_t _INIT_VEC_CAP = 128
6155

pandas/_libs/lib.pyx

+1-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ cdef double NAN = nan
4848
# this is our tseries.pxd
4949
from datetime cimport (
5050
get_timedelta64_value, get_datetime64_value,
51-
npy_timedelta, npy_datetime,
5251
PyDateTime_Check, PyDate_Check, PyTime_Check, PyDelta_Check,
5352
PyDateTime_IMPORT)
5453

@@ -62,11 +61,8 @@ from interval import Interval
6261

6362
cdef int64_t NPY_NAT = util.get_nat()
6463

65-
ctypedef unsigned char UChar
66-
6764
cimport util
68-
from util cimport (is_array, _checknull, _checknan, INT64_MAX,
69-
INT64_MIN, UINT8_MAX)
65+
from util cimport is_array, _checknull, _checknan
7066

7167
cdef extern from "math.h":
7268
double sqrt(double x)

pandas/_libs/period.pyx

+3-9
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ from cpython cimport (
77
PyObject_RichCompareBool,
88
Py_EQ, Py_NE)
99

10-
from numpy cimport (int8_t, int32_t, int64_t, import_array, ndarray,
11-
NPY_INT64, NPY_DATETIME, NPY_TIMEDELTA)
10+
from numpy cimport int64_t, import_array, ndarray
1211
import numpy as np
1312
import_array()
1413

@@ -23,12 +22,11 @@ from datetime cimport (
2322
pandas_datetimestruct,
2423
pandas_datetimestruct_to_datetime,
2524
pandas_datetime_to_datetimestruct,
26-
PANDAS_FR_ns,
27-
INT32_MIN)
25+
PANDAS_FR_ns)
2826

2927

3028
cimport util
31-
from util cimport is_period_object, is_string_object
29+
from util cimport is_period_object, is_string_object, INT32_MIN
3230

3331
from lib cimport is_null_datetimelike
3432
from pandas._libs import tslib
@@ -90,12 +88,8 @@ cdef extern from "period_helper.h":
9088
int microseconds, int picoseconds,
9189
int freq) nogil except INT32_MIN
9290

93-
int64_t get_python_ordinal(int64_t period_ordinal,
94-
int freq) except INT32_MIN
95-
9691
int get_date_info(int64_t ordinal, int freq,
9792
date_info *dinfo) nogil except INT32_MIN
98-
double getAbsTime(int, int64_t, int64_t)
9993

10094
int pyear(int64_t ordinal, int freq) except INT32_MIN
10195
int pqyear(int64_t ordinal, int freq) except INT32_MIN

pandas/_libs/tslib.pyx

-8
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ from cpython cimport (
2121
cdef extern from "Python.h":
2222
cdef PyTypeObject *Py_TYPE(object)
2323

24-
# this is our datetime.pxd
2524
from libc.stdlib cimport free
2625

2726
from util cimport (is_integer_object, is_float_object, is_datetime64_object,
@@ -65,11 +64,8 @@ from .tslibs.parsing import parse_datetime_string
6564

6665
cimport cython
6766

68-
import time
69-
7067
from pandas.compat import iteritems, callable
7168

72-
import operator
7369
import collections
7470
import warnings
7571

@@ -933,10 +929,6 @@ cdef int64_t _NS_UPPER_BOUND = INT64_MAX
933929
# use the smallest value with a 0 nanosecond unit (0s in last 3 digits)
934930
cdef int64_t _NS_LOWER_BOUND = -9223372036854775000
935931

936-
cdef pandas_datetimestruct _NS_MIN_DTS, _NS_MAX_DTS
937-
pandas_datetime_to_datetimestruct(_NS_LOWER_BOUND, PANDAS_FR_ns, &_NS_MIN_DTS)
938-
pandas_datetime_to_datetimestruct(_NS_UPPER_BOUND, PANDAS_FR_ns, &_NS_MAX_DTS)
939-
940932
# Resolution is in nanoseconds
941933
Timestamp.min = Timestamp(_NS_LOWER_BOUND)
942934
Timestamp.max = Timestamp(_NS_UPPER_BOUND)

0 commit comments

Comments
 (0)