Skip to content

Commit 3bc2def

Browse files
coreylaneclaude
andcommitted
Add missing age and caughtstealingpercentage fields to SimplePitchingSplit
Fixes #232 The MLB API now includes 'age' and 'caughtstealingpercentage' fields in pitcher statistics responses. These fields were missing from the SimplePitchingSplit dataclass, causing TypeError when trying to initialize the object with API response data. Changes: - Added age: Optional[int] = None to SimplePitchingSplit - Added caughtstealingpercentage: Optional[str] = None to SimplePitchingSplit - Updated docstring to document the new age field Tested with player ID 641793 which consistently reproduced the issue. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 267dc92 commit 3bc2def

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

mlbstatsapi/models/stats/pitching.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ class SimplePitchingSplit:
150150
The number of inherited runners scored by the pitcher.
151151
inheritedrunners : int
152152
The number of inherited runners for the pitcher.
153+
age : int
154+
The age of the pitcher.
153155
"""
154156
summary: Optional[str] = None
155157
gamesplayed: Optional[int] = None
@@ -216,6 +218,8 @@ class SimplePitchingSplit:
216218
balls: Optional[int] = None
217219
outspitched: Optional[int] = None
218220
rbi: Optional[int] = None
221+
age: Optional[int] = None
222+
caughtstealingpercentage: Optional[str] = None
219223

220224
def __repr__(self) -> str:
221225
kws = [f'{key}={value}' for key, value in self.__dict__.items() if value is not None and value]

0 commit comments

Comments
 (0)