Skip to content

Commit b619e9a

Browse files
committed
Enabled ruff rule SIM102
1 parent 77c85c4 commit b619e9a

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ ignore = [
9494
# "RUF012",
9595
# "FBT003",
9696
# "C416",
97-
"SIM102",
97+
# "SIM102",
9898
"PGH003",
9999
"PLR2004",
100100
"PERF401",

python/datafusion/dataframe.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,14 @@ def join(
511511
# This check is to prevent breaking API changes where users prior to
512512
# DF 43.0.0 would pass the join_keys as a positional argument instead
513513
# of a keyword argument.
514-
if isinstance(on, tuple) and len(on) == 2:
515-
if isinstance(on[0], list) and isinstance(on[1], list):
516-
join_keys = on # type: ignore
517-
on = None
514+
if (
515+
isinstance(on, tuple)
516+
and len(on) == 2
517+
and isinstance(on[0], list)
518+
and isinstance(on[1], list)
519+
):
520+
join_keys = on # type: ignore
521+
on = None
518522

519523
if join_keys is not None:
520524
warnings.warn(
@@ -723,9 +727,11 @@ def write_parquet(
723727
if isinstance(compression, str):
724728
compression = Compression.from_str(compression)
725729

726-
if compression in {Compression.GZIP, Compression.BROTLI, Compression.ZSTD}:
727-
if compression_level is None:
728-
compression_level = compression.get_default_level()
730+
if (
731+
compression in {Compression.GZIP, Compression.BROTLI, Compression.ZSTD}
732+
and compression_level is None
733+
):
734+
compression_level = compression.get_default_level()
729735

730736
self.df.write_parquet(str(path), compression.value, compression_level)
731737

0 commit comments

Comments
 (0)