@@ -12,6 +12,22 @@ iNaT = util.get_nat()
1212cdef bint PY2 = sys.version_info[0 ] == 2
1313cdef double nan = < double > np.NaN
1414
15+ cdef extern from " numpy/arrayobject.h" :
16+ # cython's numpy.dtype specification is incorrect, which leads to
17+ # errors in issubclass(self.dtype.type, np.bool_), so we directly
18+ # include the correct version
19+ # https://github.com/cython/cython/issues/2022
20+
21+ ctypedef class numpy.dtype [object PyArray_Descr]:
22+ # Use PyDataType_* macros when possible, however there are no macros
23+ # for accessing some of the fields, so some are defined. Please
24+ # ask on cython-dev if you need more.
25+ cdef int type_num
26+ cdef int itemsize " elsize"
27+ cdef char byteorder
28+ cdef object fields
29+ cdef tuple names
30+
1531from util cimport UINT8_MAX, UINT64_MAX, INT64_MAX, INT64_MIN
1632
1733# core.common import for fast inference checks
@@ -609,13 +625,13 @@ cdef class Validator:
609625
610626 cdef:
611627 Py_ssize_t n
612- cnp. dtype dtype
628+ dtype dtype
613629 bint skipna
614630
615631 def __cinit__ (
616632 self ,
617633 Py_ssize_t n ,
618- cnp. dtype dtype = np.dtype(np.object_),
634+ dtype dtype = np.dtype(np.object_),
619635 bint skipna = False
620636 ):
621637 self .n = n
@@ -823,7 +839,7 @@ cdef class TemporalValidator(Validator):
823839 def __cinit__ (
824840 self ,
825841 Py_ssize_t n ,
826- cnp. dtype dtype = np.dtype(np.object_),
842+ dtype dtype = np.dtype(np.object_),
827843 bint skipna = False
828844 ):
829845 self .n = n
0 commit comments