Implement or document lob_2outs and rbipercent fields in SeasonPitchingStats #28

Closed
opened 2026-02-20 06:50:20 +00:00 by cal · 1 comment
Owner

app/dependencies.py:405 — Both fields are hardcoded to 0.0 in the INSERT and never calculated. The model defines both as non-nullable FloatField().

Priority: low | Labels: todo, tech-debt

`app/dependencies.py:405` — Both fields are hardcoded to `0.0` in the INSERT and never calculated. The model defines both as non-nullable `FloatField()`. **Priority**: low | **Labels**: todo, tech-debt
cal added the
ai-working
label 2026-03-08 14:31:04 +00:00
Author
Owner

Fixed in PR #59.

Added SQL expressions to the pitching_stats CTE in update_season_pitching_stats() to calculate both fields from stratplay data:

  • lob_2outs: runners stranded when pitcher recorded the 3rd out (mirrors batting-side count_lo*_3out logic)
  • rbipercent: RBI allowed (excluding HR) per runner opportunity

The INSERT SELECT now uses ps.lob_2outs, ps.rbipercent instead of the hardcoded 0.0, 0.0.

Fixed in PR #59. Added SQL expressions to the `pitching_stats` CTE in `update_season_pitching_stats()` to calculate both fields from `stratplay` data: - `lob_2outs`: runners stranded when pitcher recorded the 3rd out (mirrors batting-side `count_lo*_3out` logic) - `rbipercent`: RBI allowed (excluding HR) per runner opportunity The INSERT SELECT now uses `ps.lob_2outs, ps.rbipercent` instead of the hardcoded `0.0, 0.0`.
cal added
ai-pr-opened
and removed
ai-working
labels 2026-03-08 14:35:23 +00:00
cal closed this issue 2026-03-10 18:26:17 +00:00
Sign in to join this conversation.
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#28
No description provided.