From 3bc2def02e4a1ae59773079e6fef9d887edd3796 Mon Sep 17 00:00:00 2001 From: coreylane Date: Fri, 29 Aug 2025 17:42:48 -0500 Subject: [PATCH 1/2] Add missing age and caughtstealingpercentage fields to SimplePitchingSplit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- mlbstatsapi/models/stats/pitching.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mlbstatsapi/models/stats/pitching.py b/mlbstatsapi/models/stats/pitching.py index c71d4ba..2ad2846 100644 --- a/mlbstatsapi/models/stats/pitching.py +++ b/mlbstatsapi/models/stats/pitching.py @@ -150,6 +150,8 @@ class SimplePitchingSplit: The number of inherited runners scored by the pitcher. inheritedrunners : int The number of inherited runners for the pitcher. + age : int + The age of the pitcher. """ summary: Optional[str] = None gamesplayed: Optional[int] = None @@ -216,6 +218,8 @@ class SimplePitchingSplit: balls: Optional[int] = None outspitched: Optional[int] = None rbi: Optional[int] = None + age: Optional[int] = None + caughtstealingpercentage: Optional[str] = None def __repr__(self) -> str: kws = [f'{key}={value}' for key, value in self.__dict__.items() if value is not None and value] From 8c070d7eafea8a66390ea9c244ccbfafc391b04f Mon Sep 17 00:00:00 2001 From: coreylane Date: Fri, 29 Aug 2025 18:10:04 -0500 Subject: [PATCH 2/2] Add caughtstealingpercentage to docstring documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updates the SimplePitchingSplit class docstring to include documentation for the caughtstealingpercentage field that was added in the previous commit. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- mlbstatsapi/models/stats/pitching.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mlbstatsapi/models/stats/pitching.py b/mlbstatsapi/models/stats/pitching.py index 2ad2846..3d4f922 100644 --- a/mlbstatsapi/models/stats/pitching.py +++ b/mlbstatsapi/models/stats/pitching.py @@ -152,6 +152,8 @@ class SimplePitchingSplit: The number of inherited runners for the pitcher. age : int The age of the pitcher. + caughtstealingpercentage : str + The caught stealing percentage for the pitcher. """ summary: Optional[str] = None gamesplayed: Optional[int] = None