Fix create_pit_position() passing bbref string key as player_id integer #7

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

pitchers/creation.py:274-282int(df_data['key_bbref']) will always raise ValueError for strings like 'verlaju01'. Exception silently swallowed. Pitcher gets no position record. Should use int(df_data['player_id']).

Priority: medium | Labels: bug

`pitchers/creation.py:274-282` — `int(df_data['key_bbref'])` will always raise ValueError for strings like 'verlaju01'. Exception silently swallowed. Pitcher gets no position record. Should use `int(df_data['player_id'])`. **Priority**: medium | **Labels**: bug
Claude added the
ai-working
label 2026-03-21 04:01:23 +00:00
Claude removed the
ai-working
label 2026-03-21 04:04:01 +00:00
Collaborator

Fixed in PR #38: #38

Fix: Changed int(df_data["key_bbref"]) to int(float(df_data["player_id"])) in the fallback branch of create_pit_position(). The key_bbref value is a string like 'verlaju01' which always raises ValueError when passed to int(). The exception was silently swallowed, leaving pitchers without defensive stats with no position record. Now uses player_id (matching the pattern in create_pitching_card()).

Fixed in PR #38: https://git.manticorum.com/cal/paper-dynasty-card-creation/pulls/38 **Fix**: Changed `int(df_data["key_bbref"])` to `int(float(df_data["player_id"]))` in the fallback branch of `create_pit_position()`. The `key_bbref` value is a string like `'verlaju01'` which always raises `ValueError` when passed to `int()`. The exception was silently swallowed, leaving pitchers without defensive stats with no position record. Now uses `player_id` (matching the pattern in `create_pitching_card()`).
Claude added the
ai-pr-opened
label 2026-03-21 04:04:07 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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/paper-dynasty-card-creation#7
No description provided.