Skip to content

Commit

Permalink
fix: put null values last (#14255)
Browse files Browse the repository at this point in the history
PG puts nulls fist when `ORDER BY DESC`
Refs: https://www.postgresql.org/docs/current/queries-order.html

Fixes WAREHOUSE-PRODUCTION-1KC
https://python-software-foundation.sentry.io/share/issue/b5f7505a29cf42849e43aa86ba067644/

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
  • Loading branch information
miketheman authored Aug 1, 2023
1 parent d88a175 commit 614b069
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion warehouse/rss/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def rss_packages(request):
newest_projects = (
request.db.query(Project)
.options(joinedload(Project.releases, innerjoin=True))
.order_by(Project.created.desc())
.order_by(Project.created.desc().nulls_last())
.limit(40)
.all()
)
Expand Down

0 comments on commit 614b069

Please sign in to comment.