@@ -1176,20 +1176,27 @@ cdef class TextReader:
1176
1176
return result, na_count
1177
1177
1178
1178
elif is_integer_dtype(dtype):
1179
- try :
1180
- result, na_count = _try_int64(self .parser, i, start,
1181
- end, na_filter, na_hashset)
1182
- if user_dtype and na_count is not None :
1183
- if na_count > 0 :
1184
- raise ValueError (f" Integer column has NA values in column {i}" )
1185
- except OverflowError as err:
1186
- if user_dtype and dtype == ' int64' :
1187
- raise err
1179
+ do_try_uint64 = False
1180
+ if user_dtype and dtype == ' uint64' :
1181
+ do_try_uint64 = True
1182
+ else :
1183
+ try :
1184
+ result, na_count = _try_int64(self .parser, i, start,
1185
+ end, na_filter, na_hashset)
1186
+ if user_dtype and na_count is not None :
1187
+ if na_count > 0 :
1188
+ raise ValueError (f" Integer column has NA values in column {i}" )
1189
+ except OverflowError as err:
1190
+ if user_dtype and dtype == ' int64' :
1191
+ raise err
1192
+ do_try_uint64 = True
1193
+
1194
+ if do_try_uint64:
1188
1195
result = _try_uint64(self .parser, i, start, end,
1189
1196
na_filter, na_hashset)
1190
1197
na_count = 0
1191
1198
1192
- if result is not None and dtype ! = ' int64' :
1199
+ if result is not None and dtype not in ( ' int64' , ' uint64 ' ) :
1193
1200
casted = result.astype(dtype)
1194
1201
if (casted == result).all():
1195
1202
result = casted
0 commit comments