fieldingstats.get_totalstats: total_count overwritten by post-filter length #101
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-database#101
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
In
app/routers_v3/fieldingstats.py, theget_totalstatsendpoint correctly computestotal_count = all_stats.count()before pagination, but then overwrites it at the end:This replaces the total count with the length of the current page (after a post-filter that excludes rows where
sum_xch + sum_sbc <= 0).Expected Behavior
countshould either reflect:Notes
Pre-existing behavior — not introduced by PR #99. Low priority.
Fixed in PR #102.
Removed the
return_stats["count"] = len(return_stats["stats"])line that was overwriting the pre-paginationtotal_countwith the post-filter page length. The correcttotal_countvalue was already being set atreturn_statsinitialization — the overwrite was just a stray line.