Skip to content

Commit

Permalink
chore: avoid printing the default value of nulls_first in asc/`de…
Browse files Browse the repository at this point in the history
…sc` decompiles
  • Loading branch information
cpcloud committed Jun 24, 2024
1 parent e34476b commit 7bfb757
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ibis/expr/decompile.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,10 @@ def table_column(op, rel, name):
@translate.register(ops.SortKey)
def sort_key(op, expr, ascending, nulls_first):
method = "asc" if ascending else "desc"
return f"{expr}.{method}(nulls_first={nulls_first})"
call = f"{expr}.{method}"
if nulls_first:
return f"{call}(nulls_first={nulls_first})"

Check warning on line 245 in ibis/expr/decompile.py

View check run for this annotation

Codecov / codecov/patch

ibis/expr/decompile.py#L245

Added line #L245 was not covered by tests
return f"{call}()"


@translate.register(ops.Reduction)
Expand Down

0 comments on commit 7bfb757

Please sign in to comment.