@@ -12,6 +12,22 @@ iNaT = util.get_nat()
12
12
cdef bint PY2 = sys.version_info[0 ] == 2
13
13
cdef double nan = < double > np.NaN
14
14
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
+
15
31
from util cimport UINT8_MAX, UINT64_MAX, INT64_MAX, INT64_MIN
16
32
17
33
# core.common import for fast inference checks
@@ -609,13 +625,13 @@ cdef class Validator:
609
625
610
626
cdef:
611
627
Py_ssize_t n
612
- cnp. dtype dtype
628
+ dtype dtype
613
629
bint skipna
614
630
615
631
def __cinit__ (
616
632
self ,
617
633
Py_ssize_t n ,
618
- cnp. dtype dtype = np.dtype(np.object_),
634
+ dtype dtype = np.dtype(np.object_),
619
635
bint skipna = False
620
636
):
621
637
self .n = n
@@ -823,7 +839,7 @@ cdef class TemporalValidator(Validator):
823
839
def __cinit__ (
824
840
self ,
825
841
Py_ssize_t n ,
826
- cnp. dtype dtype = np.dtype(np.object_),
842
+ dtype dtype = np.dtype(np.object_),
827
843
bint skipna = False
828
844
):
829
845
self .n = n
0 commit comments