Skip to content

Commit cae0644

Browse files
committed
Add entry to upgrade guide
1 parent 80bbece commit cae0644

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

‎docs/source/user-guide/upgrade-guides.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,30 @@
1919

2020
# Upgrade Guides
2121

22+
## DataFusion 56.0.0
23+
24+
### `sort` and `order_by` now order `NULLS LAST` by default
25+
26+
Calling `.sort(...)` on a DataFrame or using the `.order_by(...)` function now
27+
orders rows with `NULLS LAST` by default, instead of `NULLS FIRST`. This follows
28+
the same behavior as SQL's `ORDER BY` or the DataFrame's `sort_by(...)`.
29+
30+
To go back to the previous behavior, we need to explicitly specify
31+
`nulls_first=True`. Example:
32+
33+
```python
34+
# sort
35+
df.sort(column("a"), nulls_first=True)
36+
37+
# order by
38+
expr = f.first_value(column("a")).over(
39+
Window(
40+
partition_by=partition,
41+
order_by=f.order_by(column("b"), nulls_first=True)
42+
)
43+
)
44+
```
45+
2246
## DataFusion 55.0.0
2347

2448
This release extends the change made in 52.0.0 to the remaining

0 commit comments

Comments
 (0)