Skip to content

Commit 00be2c2

Browse files
committed
chore: improve flag variable name
1 parent 40983dd commit 00be2c2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pandas/_libs/parsers.pyx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ cdef class TextReader:
11371137
bint na_filter,
11381138
bint user_dtype,
11391139
kh_str_starts_t *na_hashset,
1140-
set na_fset, bint raise_on_float):
1140+
set na_fset, bint raise_on_invalid):
11411141
if isinstance(dtype, CategoricalDtype):
11421142
# TODO: I suspect that _categorical_convert could be
11431143
# optimized when dtype is an instance of CategoricalDtype
@@ -1179,13 +1179,13 @@ cdef class TextReader:
11791179
elif dtype.kind in "iu":
11801180
try:
11811181
result, na_count = _try_int64(self.parser, i, start, end,
1182-
na_filter, na_hashset, raise_on_float)
1182+
na_filter, na_hashset, raise_on_invalid)
11831183
if user_dtype and na_count is not None:
11841184
if na_count > 0:
11851185
raise ValueError(f"Integer column has NA values in column {i}")
11861186
except OverflowError:
11871187
result = _try_uint64(self.parser, i, start, end,
1188-
na_filter, na_hashset, raise_on_float)
1188+
na_filter, na_hashset, raise_on_invalid)
11891189
na_count = 0
11901190

11911191
if result is not None and dtype != "int64":
@@ -1745,7 +1745,7 @@ cdef int _try_double_nogil(parser_t *parser,
17451745
cdef _try_uint64(parser_t *parser, int64_t col,
17461746
int64_t line_start, int64_t line_end,
17471747
bint na_filter, kh_str_starts_t *na_hashset,
1748-
bint raise_on_float):
1748+
bint raise_on_invalid):
17491749
cdef:
17501750
int error
17511751
Py_ssize_t lines
@@ -1767,9 +1767,9 @@ cdef _try_uint64(parser_t *parser, int64_t col,
17671767
if error == ERROR_OVERFLOW:
17681768
# Can't get the word variable
17691769
raise OverflowError("Overflow")
1770-
elif raise_on_float and error == ERROR_INVALID_CHARS:
1770+
elif raise_on_invalid and error == ERROR_INVALID_CHARS:
17711771
raise ValueError("Number is not int")
1772-
elif not raise_on_float or error != ERROR_INVALID_CHARS:
1772+
elif not raise_on_invalid or error != ERROR_INVALID_CHARS:
17731773
return None
17741774

17751775
if uint64_conflict(&state):
@@ -1818,7 +1818,7 @@ cdef int _try_uint64_nogil(parser_t *parser, int64_t col,
18181818

18191819
cdef _try_int64(parser_t *parser, int64_t col,
18201820
int64_t line_start, int64_t line_end,
1821-
bint na_filter, kh_str_starts_t *na_hashset, bint raise_on_float):
1821+
bint na_filter, kh_str_starts_t *na_hashset, bint raise_on_invalid):
18221822
cdef:
18231823
int error = 0
18241824
int na_count = 0
@@ -1839,9 +1839,9 @@ cdef _try_int64(parser_t *parser, int64_t col,
18391839
if error == ERROR_OVERFLOW:
18401840
# Can't get the word variable
18411841
raise OverflowError("Overflow")
1842-
elif raise_on_float and error == ERROR_INVALID_CHARS:
1842+
elif raise_on_invalid and error == ERROR_INVALID_CHARS:
18431843
raise ValueError("Number is not int")
1844-
elif not raise_on_float or error != ERROR_INVALID_CHARS:
1844+
elif not raise_on_invalid or error != ERROR_INVALID_CHARS:
18451845
return None, None
18461846

18471847
return result, na_count

0 commit comments

Comments
 (0)