Skip to content

Commit 8b4212f

Browse files
committed
Enabled ruff rule B008
1 parent b7027d5 commit 8b4212f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ ignore = [
8282
# TODO: Enable all of the following, but this PR is getting too large already
8383
#"PT001",
8484
# "ANN204",
85-
"B008",
85+
# "B008",
8686
"EM101",
8787
"PLR0913",
8888
"PLR1714",

python/datafusion/functions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,13 +799,15 @@ def right(string: Expr, n: Expr) -> Expr:
799799
return Expr(f.right(string.expr, n.expr))
800800

801801

802-
def round(value: Expr, decimal_places: Expr = Expr.literal(0)) -> Expr:
802+
def round(value: Expr, decimal_places: Expr | None = None) -> Expr:
803803
"""Round the argument to the nearest integer.
804804
805805
If the optional ``decimal_places`` is specified, round to the nearest number of
806806
decimal places. You can specify a negative number of decimal places. For example
807807
``round(lit(125.2345), lit(-2))`` would yield a value of ``100.0``.
808808
"""
809+
if decimal_places is None:
810+
decimal_places = Expr.literal(0)
809811
return Expr(f.round(value.expr, decimal_places.expr))
810812

811813

0 commit comments

Comments
 (0)