Skip to content

Commit 08158c0

Browse files
jbrockmendeljreback
authored andcommitted
Follow-Up To #17875 (#18043)
1 parent c65a0f5 commit 08158c0

File tree

5 files changed

+100
-124
lines changed

5 files changed

+100
-124
lines changed

pandas/_libs/lib.pyx

+6-10
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,16 @@ cimport cpython
4343
isnan = np.isnan
4444
cdef double NaN = <double> np.NaN
4545
cdef double nan = NaN
46-
cdef double NAN = nan
4746

47+
from cpython.datetime cimport (PyDateTime_Check, PyDate_Check,
48+
PyTime_Check, PyDelta_Check,
49+
PyDateTime_IMPORT)
50+
PyDateTime_IMPORT
4851
# this is our tseries.pxd
49-
from datetime cimport (
50-
get_timedelta64_value, get_datetime64_value,
51-
PyDateTime_Check, PyDate_Check, PyTime_Check, PyDelta_Check,
52-
PyDateTime_IMPORT)
52+
from datetime cimport get_timedelta64_value, get_datetime64_value
5353

5454

55-
from tslib cimport (convert_to_tsobject, convert_to_timedelta64,
56-
_check_all_nulls)
55+
from tslib cimport _check_all_nulls
5756
import tslib
5857
from tslib import NaT, Timestamp, Timedelta
5958
import interval
@@ -68,9 +67,6 @@ cdef extern from "math.h":
6867
double sqrt(double x)
6968
double fabs(double)
7069

71-
# import datetime C API
72-
PyDateTime_IMPORT
73-
7470
# initialize numpy
7571
import_array()
7672
import_ufunc()

pandas/_libs/src/inference.pyx

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ from decimal import Decimal
33
cimport util
44
cimport cython
55
from tslib import NaT
6+
from tslib cimport convert_to_tsobject, convert_to_timedelta64
67
from tslibs.timezones cimport get_timezone
78
from datetime import datetime, timedelta
89
iNaT = util.get_nat()

0 commit comments

Comments
 (0)