Skip to content

STYLE: fix pylint no-else-break warnings #49237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/io/parsers/python_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ def _next_line(self) -> list[Scalar]:
self._is_line_empty(self.data[self.pos - 1]) or line
):
break
elif self.skip_blank_lines:
if self.skip_blank_lines:
ret = self._remove_empty_lines([line])
if ret:
line = ret[0]
Expand Down
58 changes: 29 additions & 29 deletions pandas/io/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -971,18 +971,18 @@ def _query_iterator(
[], columns=columns, coerce_float=coerce_float
)
break
else:
has_read_data = True
self.frame = DataFrame.from_records(
data, columns=columns, coerce_float=coerce_float
)

self._harmonize_columns(parse_dates=parse_dates)
has_read_data = True
self.frame = DataFrame.from_records(
data, columns=columns, coerce_float=coerce_float
)

if self.index is not None:
self.frame.set_index(self.index, inplace=True)
self._harmonize_columns(parse_dates=parse_dates)

if self.index is not None:
self.frame.set_index(self.index, inplace=True)

yield self.frame
yield self.frame

def read(
self,
Expand Down Expand Up @@ -1489,16 +1489,16 @@ def _query_iterator(
parse_dates=parse_dates,
)
break
else:
has_read_data = True
yield _wrap_result(
data,
columns,
index_col=index_col,
coerce_float=coerce_float,
parse_dates=parse_dates,
dtype=dtype,
)

has_read_data = True
yield _wrap_result(
data,
columns,
index_col=index_col,
coerce_float=coerce_float,
parse_dates=parse_dates,
dtype=dtype,
)

def read_query(
self,
Expand Down Expand Up @@ -2053,16 +2053,16 @@ def _query_iterator(
[], columns=columns, coerce_float=coerce_float
)
break
else:
has_read_data = True
yield _wrap_result(
data,
columns,
index_col=index_col,
coerce_float=coerce_float,
parse_dates=parse_dates,
dtype=dtype,
)

has_read_data = True
yield _wrap_result(
data,
columns,
index_col=index_col,
coerce_float=coerce_float,
parse_dates=parse_dates,
dtype=dtype,
)

def read_query(
self,
Expand Down
5 changes: 2 additions & 3 deletions pandas/plotting/_matplotlib/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,8 @@ def __call__(self):
if num <= interval * (max_millis_ticks - 1):
self._interval = interval
break
else:
# We went through the whole loop without breaking, default to 1
self._interval = 1000.0
# We went through the whole loop without breaking, default to 1
self._interval = 1000.0

estimate = (nmax - nmin) / (self._get_unit() * self._get_interval())

Expand Down
5 changes: 2 additions & 3 deletions pandas/tests/io/test_user_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,8 @@ def responder(request):
if wait_time > kill_time:
server_process.kill()
break
else:
wait_time += 0.1
time.sleep(0.1)
wait_time += 0.1
time.sleep(0.1)
server_process.close()


Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ disable = [
"inconsistent-return-statements",
"invalid-sequence-index",
"literal-comparison",
"no-else-break",
"no-else-continue",
"no-else-raise",
"no-else-return",
Expand Down