Skip to content

Commit a26950b

Browse files
committed
Enabled ruff rule PERF401
1 parent 924aacf commit a26950b

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

benchmarks/tpch/tpch.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,7 @@ def bench(data_path, query_path) -> None:
6868
with open(f"{query_path}/q{query}.sql") as f:
6969
text = f.read()
7070
tmp = text.split(";")
71-
queries = []
72-
for str in tmp:
73-
if len(str.strip()) > 0:
74-
queries.append(str.strip())
71+
queries = [s.strip() for s in tmp if len(s.strip()) > 0]
7572

7673
try:
7774
start = time.time()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ ignore = [
9797
# "SIM102",
9898
# "PGH003",
9999
"PLR2004",
100-
"PERF401",
100+
# "PERF401",
101101
"PD901",
102102
"EM102",
103103
"ERA001",

python/datafusion/dataframe.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,7 @@ def _simplify_expression(
285285
if isinstance(expr, Expr):
286286
expr_list.append(expr.expr)
287287
elif isinstance(expr, Iterable):
288-
for inner_expr in expr:
289-
expr_list.append(inner_expr.expr)
288+
expr_list.extend(inner_expr.expr for inner_expr in expr)
290289
else:
291290
raise NotImplementedError
292291
if named_exprs:

0 commit comments

Comments
 (0)