File tree 3 files changed +12
-3
lines changed
3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -1229,7 +1229,10 @@ cdef class TextReader:
1229
1229
na_count = 0
1230
1230
1231
1231
if result is not None and dtype != ' int64' :
1232
- result = result.astype(dtype)
1232
+ try :
1233
+ result = result.astype(dtype)
1234
+ except TypeError :
1235
+ result = result.astype(dtype.numpy_dtype)
1233
1236
1234
1237
return result, na_count
1235
1238
@@ -1238,7 +1241,10 @@ cdef class TextReader:
1238
1241
na_filter, na_hashset, na_flist)
1239
1242
1240
1243
if result is not None and dtype != ' float64' :
1241
- result = result.astype(dtype)
1244
+ try :
1245
+ result = result.astype(dtype)
1246
+ except TypeError :
1247
+ result = result.astype(dtype.numpy_dtype)
1242
1248
return result, na_count
1243
1249
1244
1250
elif is_bool_dtype(dtype):
Original file line number Diff line number Diff line change @@ -1904,7 +1904,10 @@ def _get_dtype_type(arr_or_dtype):
1904
1904
try :
1905
1905
return arr_or_dtype .dtype .type
1906
1906
except AttributeError :
1907
- return type (None )
1907
+ try :
1908
+ return arr_or_dtype .numpy_dtype .type
1909
+ except AttributeError :
1910
+ return type (None )
1908
1911
1909
1912
1910
1913
def _get_dtype_from_object (dtype ):
You can’t perform that action at this time.
0 commit comments