Skip to content

Commit 363d24f

Browse files
committed
Enabled ruff rule FBT003
1 parent 590c72f commit 363d24f

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

benchmarks/db-benchmark/groupby-datafusion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ def execute(df) -> list:
9393
)
9494
config = (
9595
SessionConfig()
96-
.with_repartition_joins(False)
97-
.with_repartition_aggregations(False)
96+
.with_repartition_joins(enabled=False)
97+
.with_repartition_aggregations(enabled=False)
9898
.set("datafusion.execution.coalesce_batches", "false")
9999
)
100100
ctx = SessionContext(config, runtime)

examples/create-context.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
runtime = RuntimeEnvBuilder().with_disk_manager_os().with_fair_spill_pool(10000000)
2626
config = (
2727
SessionConfig()
28-
.with_create_default_catalog_and_schema(True)
28+
.with_create_default_catalog_and_schema(enabled=True)
2929
.with_default_catalog_and_schema("foo", "bar")
3030
.with_target_partitions(8)
31-
.with_information_schema(True)
32-
.with_repartition_joins(False)
33-
.with_repartition_aggregations(False)
34-
.with_repartition_windows(False)
35-
.with_parquet_pruning(False)
31+
.with_information_schema(enabled=True)
32+
.with_repartition_joins(enabled=False)
33+
.with_repartition_aggregations(enabled=False)
34+
.with_repartition_windows(enabled=False)
35+
.with_parquet_pruning(enabled=False)
3636
.set("datafusion.execution.parquet.pushdown_filters", "true")
3737
)
3838
ctx = SessionContext(config, runtime)

examples/tpch/q08_market_share.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
df = df.with_column(
151151
"national_volume",
152152
F.case(col("s_suppkey").is_null())
153-
.when(lit(False), col("volume"))
153+
.when(lit(value=False), col("volume"))
154154
.otherwise(lit(0.0)),
155155
)
156156

examples/tpch/q21_suppliers_kept_orders_waiting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
df = df.with_column(
6666
"failed_supp",
6767
F.case(col("l_receiptdate") > col("l_commitdate"))
68-
.when(lit(True), col("l_suppkey"))
68+
.when(lit(value=True), col("l_suppkey"))
6969
.end(),
7070
)
7171

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ ignore = [
9292
# "B904",
9393
# "UP006",
9494
# "RUF012",
95-
"FBT003",
95+
# "FBT003",
9696
"C416",
9797
"SIM102",
9898
"PGH003",

python/datafusion/expr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def sort_or_default(e: Expr | SortExpr) -> expr_internal.SortExpr:
176176
"""Helper function to return a default Sort if an Expr is provided."""
177177
if isinstance(e, SortExpr):
178178
return e.raw_sort
179-
return SortExpr(e, True, True).raw_sort
179+
return SortExpr(e, ascending=True, nulls_first=True).raw_sort
180180

181181

182182
def sort_list_to_raw_sort_list(

python/tests/test_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def test_literal(df):
8181
literal("1"),
8282
literal("OK"),
8383
literal(3.14),
84-
literal(True),
84+
literal(value=True),
8585
literal(b"hello world"),
8686
)
8787
result = df.collect()

0 commit comments

Comments
 (0)