Skip to content

Commit b606c24

Browse files
mgmarinopull[bot]
authored andcommitted
CI: Address linting errors in flake8 >= 3.8.1 (#34152)
1 parent fb3a140 commit b606c24

File tree

8 files changed

+12
-13
lines changed

8 files changed

+12
-13
lines changed

pandas/core/arrays/interval.py

+1
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,7 @@ def mid(self):
10491049
points) and is either monotonic increasing or monotonic decreasing,
10501050
else False.
10511051
"""
1052+
10521053
# https://github.com/python/mypy/issues/1362
10531054
# Mypy does not support decorated properties
10541055
@property # type: ignore

pandas/core/internals/concat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ def _is_uniform_join_units(join_units: List[JoinUnit]) -> bool:
443443
# cannot necessarily join
444444
return (
445445
# all blocks need to have the same type
446-
all(type(ju.block) is type(join_units[0].block) for ju in join_units)
446+
all(isinstance(ju.block, type(join_units[0].block)) for ju in join_units)
447447
and # noqa
448448
# no blocks that would get missing values (can lead to type upcasts)
449449
# unless we're an extension dtype.

pandas/core/series.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -2584,10 +2584,7 @@ def append(self, to_append, ignore_index=False, verify_integrity=False):
25842584
else:
25852585
to_concat = [self, to_append]
25862586
if any(isinstance(x, (ABCDataFrame,)) for x in to_concat[1:]):
2587-
msg = (
2588-
f"to_append should be a Series or list/tuple of Series, "
2589-
f"got DataFrame"
2590-
)
2587+
msg = "to_append should be a Series or list/tuple of Series, got DataFrame"
25912588
raise TypeError(msg)
25922589
return concat(
25932590
to_concat, ignore_index=ignore_index, verify_integrity=verify_integrity

pandas/tests/groupby/aggregate/test_numba.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ def incorrect_function(x):
1818
{"key": ["a", "a", "b", "b", "a"], "data": [1.0, 2.0, 3.0, 4.0, 5.0]},
1919
columns=["key", "data"],
2020
)
21-
with pytest.raises(NumbaUtilError, match=f"The first 2"):
21+
with pytest.raises(NumbaUtilError, match="The first 2"):
2222
data.groupby("key").agg(incorrect_function, engine="numba")
2323

24-
with pytest.raises(NumbaUtilError, match=f"The first 2"):
24+
with pytest.raises(NumbaUtilError, match="The first 2"):
2525
data.groupby("key")["data"].agg(incorrect_function, engine="numba")
2626

2727

pandas/tests/groupby/test_categorical.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,9 @@ def test_dataframe_categorical_ordered_observed_sort(ordered, observed, sort):
502502
aggr[aggr.isna()] = "missing"
503503
if not all(label == aggr):
504504
msg = (
505-
f"Labels and aggregation results not consistently sorted\n"
506-
+ "for (ordered={ordered}, observed={observed}, sort={sort})\n"
507-
+ "Result:\n{result}"
505+
"Labels and aggregation results not consistently sorted\n"
506+
f"for (ordered={ordered}, observed={observed}, sort={sort})\n"
507+
f"Result:\n{result}"
508508
)
509509
assert False, msg
510510

pandas/tests/groupby/transform/test_numba.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ def incorrect_function(x):
1717
{"key": ["a", "a", "b", "b", "a"], "data": [1.0, 2.0, 3.0, 4.0, 5.0]},
1818
columns=["key", "data"],
1919
)
20-
with pytest.raises(NumbaUtilError, match=f"The first 2"):
20+
with pytest.raises(NumbaUtilError, match="The first 2"):
2121
data.groupby("key").transform(incorrect_function, engine="numba")
2222

23-
with pytest.raises(NumbaUtilError, match=f"The first 2"):
23+
with pytest.raises(NumbaUtilError, match="The first 2"):
2424
data.groupby("key")["data"].transform(incorrect_function, engine="numba")
2525

2626

pandas/tests/io/test_stata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1861,7 +1861,7 @@ def test_writer_118_exceptions(self):
18611861
@pytest.mark.parametrize("version", [105, 108, 111, 113, 114])
18621862
def test_backward_compat(version, datapath):
18631863
data_base = datapath("io", "data", "stata")
1864-
ref = os.path.join(data_base, f"stata-compat-118.dta")
1864+
ref = os.path.join(data_base, "stata-compat-118.dta")
18651865
old = os.path.join(data_base, f"stata-compat-{version}.dta")
18661866
expected = pd.read_stata(ref)
18671867
old_dta = pd.read_stata(old)

setup.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ ignore =
1919
W504, # line break after binary operator
2020
E402, # module level import not at top of file
2121
E731, # do not assign a lambda expression, use a def
22+
E741, # ambiguous variable name 'l' (GH#34150)
2223
C406, # Unnecessary list literal - rewrite as a dict literal.
2324
C408, # Unnecessary dict call - rewrite as a literal.
2425
C409, # Unnecessary list passed to tuple() - rewrite as a tuple literal.

0 commit comments

Comments
 (0)