Skip to content

Commit 1a50d99

Browse files
timsaucerclaude
andcommitted
docs: note sum/avg distinct argument-order breaking change
distinct is inserted before filter on sum and avg for consistency with the other aggregate functions, breaking positional filter callers. Add a DataFusion 54.0.0 upgrade-guide entry covering the migration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d16b568 commit 1a50d99

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

docs/source/user-guide/upgrade-guides.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,29 @@
1818
Upgrade Guides
1919
==============
2020

21+
DataFusion 54.0.0
22+
-----------------
23+
24+
The aggregate functions :py:func:`~datafusion.functions.sum` and
25+
:py:func:`~datafusion.functions.avg` now accept a ``distinct`` argument, matching
26+
the other aggregate functions. ``distinct`` is inserted *before* ``filter`` in the
27+
argument list, so any code that passed ``filter`` positionally must be updated to
28+
pass it as a keyword argument.
29+
30+
Before:
31+
32+
.. code-block:: python
33+
34+
f.sum(column("a"), my_filter)
35+
f.avg(column("a"), my_filter)
36+
37+
Now:
38+
39+
.. code-block:: python
40+
41+
f.sum(column("a"), filter=my_filter)
42+
f.avg(column("a"), filter=my_filter)
43+
2144
DataFusion 53.0.0
2245
-----------------
2346

0 commit comments

Comments
 (0)