feat: increase MAX_LIMIT to 1000 for plays batting/fielding/pitching (#111) #113

Merged
cal merged 1 commits from issue/111-feat-increase-max-limit-to-1000-for-plays-fielding into main 2026-04-08 12:53:41 +00:00
Collaborator

Closes #111

Increases the maximum allowed limit query parameter from 500 (MAX_LIMIT) to 1000 for the three play-level stat endpoints:

  • GET /api/v3/plays/batting
  • GET /api/v3/plays/fielding
  • GET /api/v3/plays/pitching

All other endpoints retain le=MAX_LIMIT (500).

Changes

  • app/routers_v3/stratplay/batting.py: le=MAX_LIMITle=1000, removed unused MAX_LIMIT import
  • app/routers_v3/stratplay/fielding.py: same
  • app/routers_v3/stratplay/pitching.py: same

This matches the existing pattern in stratgame.py which already uses le=1000 directly.

Tests

No test suite for this repo. Changes verified by reading back modified files — the only functional change is the raised upper bound on the limit parameter validator.

Closes #111 Increases the maximum allowed `limit` query parameter from 500 (`MAX_LIMIT`) to 1000 for the three play-level stat endpoints: - `GET /api/v3/plays/batting` - `GET /api/v3/plays/fielding` - `GET /api/v3/plays/pitching` All other endpoints retain `le=MAX_LIMIT` (500). ## Changes - `app/routers_v3/stratplay/batting.py`: `le=MAX_LIMIT` → `le=1000`, removed unused `MAX_LIMIT` import - `app/routers_v3/stratplay/fielding.py`: same - `app/routers_v3/stratplay/pitching.py`: same This matches the existing pattern in `stratgame.py` which already uses `le=1000` directly. ## Tests No test suite for this repo. Changes verified by reading back modified files — the only functional change is the raised upper bound on the `limit` parameter validator.
Claude added 1 commit 2026-04-08 11:32:59 +00:00
Closes #111

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude added the
ai-reviewing
label 2026-04-08 11:45:50 +00:00
Claude reviewed 2026-04-08 11:47:23 +00:00
Claude left a comment
Author
Collaborator

AI Code Review

Files Reviewed

  • app/routers_v3/stratplay/batting.py (modified)
  • app/routers_v3/stratplay/fielding.py (modified)
  • app/routers_v3/stratplay/pitching.py (modified)

Findings

Correctness

  • No issues found. The change to le=1000 is applied consistently across all three play-level stat endpoints.
  • MAX_LIMIT import removal is correct in all three files — after the change, MAX_LIMIT is unused in each.
  • plays.py (general play queries) intentionally retains le=MAX_LIMIT (500) per the PR description.
  • DEFAULT_LIMIT = 200 is still within the new upper bound, so the default remains valid.
  • stratgame.py:63 confirmed to already use le=1000 directly — the stated precedent is accurate.

Security

  • No issues found. Relaxing the upper bound from 500 → 1000 increases max response size for play endpoints. Play-level data is aggregated (not raw play-by-play rows), so this is proportionate. No injection, auth, or credential concerns.

Style & Conventions

  • No issues found. Using a hardcoded 1000 rather than a new named constant (e.g. PLAYS_MAX_LIMIT) is consistent with the existing stratgame.py precedent and is acceptable given only four endpoints would ever use it.

Suggestions

  • None.

Verdict: COMMENT

Clean, minimal change. Logic is correct, imports are cleaned up appropriately, and the pattern matches the existing stratgame.py precedent. The existing integration test (limit=500 in test_stratplay_routes.py) remains valid since 500 ≤ 1000. Approved.


Automated review by Claude PR Reviewer

## AI Code Review ### Files Reviewed - `app/routers_v3/stratplay/batting.py` (modified) - `app/routers_v3/stratplay/fielding.py` (modified) - `app/routers_v3/stratplay/pitching.py` (modified) ### Findings #### Correctness - No issues found. The change to `le=1000` is applied consistently across all three play-level stat endpoints. - `MAX_LIMIT` import removal is correct in all three files — after the change, `MAX_LIMIT` is unused in each. - `plays.py` (general play queries) intentionally retains `le=MAX_LIMIT` (500) per the PR description. - `DEFAULT_LIMIT = 200` is still within the new upper bound, so the default remains valid. - `stratgame.py:63` confirmed to already use `le=1000` directly — the stated precedent is accurate. #### Security - No issues found. Relaxing the upper bound from 500 → 1000 increases max response size for play endpoints. Play-level data is aggregated (not raw play-by-play rows), so this is proportionate. No injection, auth, or credential concerns. #### Style & Conventions - No issues found. Using a hardcoded `1000` rather than a new named constant (e.g. `PLAYS_MAX_LIMIT`) is consistent with the existing `stratgame.py` precedent and is acceptable given only four endpoints would ever use it. #### Suggestions - None. ### Verdict: COMMENT Clean, minimal change. Logic is correct, imports are cleaned up appropriately, and the pattern matches the existing `stratgame.py` precedent. The existing integration test (`limit=500` in `test_stratplay_routes.py`) remains valid since 500 ≤ 1000. Approved. --- *Automated review by Claude PR Reviewer*
Claude added
ai-reviewed
and removed
ai-reviewing
labels 2026-04-08 11:47:47 +00:00
cal merged commit 5d5df325bc into main 2026-04-08 12:53:41 +00:00
cal deleted branch issue/111-feat-increase-max-limit-to-1000-for-plays-fielding 2026-04-08 12:53:41 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/major-domo-database#113
No description provided.