Skip to content

Commit 927ddad

Browse files
CLN: simplified conditional logic for int parsing
1 parent 61a36a5 commit 927ddad

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

pandas/_libs/parsers.pyx

+6-8
Original file line numberDiff line numberDiff line change
@@ -1176,9 +1176,10 @@ cdef class TextReader:
11761176
return result, na_count
11771177

11781178
elif is_integer_dtype(dtype):
1179-
do_try_uint64 = False
11801179
if user_dtype and dtype == 'uint64':
1181-
do_try_uint64 = True
1180+
result = _try_uint64(self.parser, i, start,
1181+
end, na_filter, na_hashset)
1182+
na_count = 0
11821183
else:
11831184
try:
11841185
result, na_count = _try_int64(self.parser, i, start,
@@ -1189,12 +1190,9 @@ cdef class TextReader:
11891190
except OverflowError as err:
11901191
if user_dtype and dtype == 'int64':
11911192
raise err
1192-
do_try_uint64 = True
1193-
1194-
if do_try_uint64:
1195-
result = _try_uint64(self.parser, i, start, end,
1196-
na_filter, na_hashset)
1197-
na_count = 0
1193+
result = _try_uint64(self.parser, i, start,
1194+
end, na_filter, na_hashset)
1195+
na_count = 0
11981196

11991197
if result is not None and dtype not in ('int64', 'uint64'):
12001198
casted = result.astype(dtype)

0 commit comments

Comments
 (0)