Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion local_examples/client-specific/redis-py/search_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@
req = (
aggregations.AggregateRequest("*")
.group_by("@category", reducers.avg("@price").alias("avg_price"))
.sort_by(aggregations.Desc("@avg_price"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aggregation example omits required sort

High Severity

The agg_avg request no longer sorts groups by @avg_price, so row order is undefined. The example output and the aggregation tutorial both show Computers first at 864.495, which only happens with a descending sort. This step is meant to teach SORTBY.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7206719. Configure here.

)
res = index.aggregate(req).rows
print(res)
Expand Down
Loading