Skip to content
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

STYLE: fix pylint no-else-continue warnings #49464

Merged
merged 2 commits into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@

if fname == "index.rst" and os.path.abspath(dirname) == source_path:
continue
elif pattern == "-api" and reldir.startswith("reference"):
if pattern == "-api" and reldir.startswith("reference"):
exclude_patterns.append(fname)
elif (
pattern == "whatsnew"
Expand Down
8 changes: 4 additions & 4 deletions pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3069,10 +3069,10 @@ def maybe_mi_droplevels(indexer, levels):
):
# everything
continue
else:
# e.g. test_xs_IndexSlice_argument_not_implemented
k_index = np.zeros(len(self), dtype=bool)
k_index[loc_level] = True

# e.g. test_xs_IndexSlice_argument_not_implemented
k_index = np.zeros(len(self), dtype=bool)
k_index[loc_level] = True

else:
k_index = loc_level
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/reshape/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ def _maybe_coerce_merge_keys(self) -> None:
continue

# check whether ints and floats
elif is_integer_dtype(rk.dtype) and is_float_dtype(lk.dtype):
if is_integer_dtype(rk.dtype) and is_float_dtype(lk.dtype):
# GH 47391 numpy > 1.24 will raise a RuntimeError for nan -> int
with np.errstate(invalid="ignore"):
# error: Argument 1 to "astype" of "ndarray" has incompatible
Expand All @@ -1314,7 +1314,7 @@ def _maybe_coerce_merge_keys(self) -> None:
)
continue

elif is_float_dtype(rk.dtype) and is_integer_dtype(lk.dtype):
if is_float_dtype(rk.dtype) and is_integer_dtype(lk.dtype):
# GH 47391 numpy > 1.24 will raise a RuntimeError for nan -> int
with np.errstate(invalid="ignore"):
# error: Argument 1 to "astype" of "ndarray" has incompatible
Expand All @@ -1337,7 +1337,7 @@ def _maybe_coerce_merge_keys(self) -> None:
continue

# let's infer and see if we are ok
elif lib.infer_dtype(lk, skipna=False) == lib.infer_dtype(
if lib.infer_dtype(lk, skipna=False) == lib.infer_dtype(
rk, skipna=False
):
continue
Expand Down
10 changes: 5 additions & 5 deletions pandas/io/formats/style_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,11 @@ def _translate_header(self, sparsify_cols: bool, max_cols: int):
for r, hide in enumerate(self.hide_columns_):
if hide or not clabels:
continue
else:
header_row = self._generate_col_header_row(
(r, clabels), max_cols, col_lengths
)
head.append(header_row)

header_row = self._generate_col_header_row(
(r, clabels), max_cols, col_lengths
)
head.append(header_row)

# 2) index names
if (
Expand Down
6 changes: 3 additions & 3 deletions pandas/io/json/_normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ def nested_to_record(
v = new_d.pop(k)
new_d[newkey] = v
continue
else:
v = new_d.pop(k)
new_d.update(nested_to_record(v, newkey, sep, level + 1, max_level))

v = new_d.pop(k)
new_d.update(nested_to_record(v, newkey, sep, level + 1, max_level))
new_ds.append(new_d)

if singleton:
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/io/parser/common/test_common_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,8 @@ def test_read_table_same_signature_as_read_csv(all_parsers):
assert table_param.annotation == csv_param.annotation
assert table_param.kind == csv_param.kind
continue
else:
assert table_param == csv_param

assert table_param == csv_param


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