Skip to content

Commit 520cae3

Browse files
CLN: moved na-check into else branch
1 parent 7cf208f commit 520cae3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/_libs/parsers.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,15 +1187,15 @@ cdef class TextReader:
11871187
try:
11881188
result, na_count = _try_int64(self.parser, i, start,
11891189
end, na_filter, na_hashset)
1190-
if user_dtype and na_count is not None:
1191-
if na_count > 0:
1192-
raise ValueError(f"Integer column has NA values in column {i}")
11931190
except OverflowError as err:
11941191
if user_dtype and dtype == 'int64':
11951192
raise err
11961193
result = _try_uint64(self.parser, i, start,
11971194
end, na_filter, na_hashset)
11981195
na_count = 0
1196+
else:
1197+
if user_dtype and (na_count is not None) and (na_count > 0):
1198+
raise ValueError(f"Integer column has NA values in column {i}")
11991199

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

0 commit comments

Comments
 (0)