Fix create_pit_position() passing bbref string key as player_id integer
#7
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-card-creation#7
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?
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 useint(df_data['player_id']).Priority: medium | Labels: bug
Fixed in PR #38: #38
Fix: Changed
int(df_data["key_bbref"])toint(float(df_data["player_id"]))in the fallback branch ofcreate_pit_position(). Thekey_bbrefvalue is a string like'verlaju01'which always raisesValueErrorwhen passed toint(). The exception was silently swallowed, leaving pitchers without defensive stats with no position record. Now usesplayer_id(matching the pattern increate_pitching_card()).