python-mlb-statsapi
python-mlb-statsapi copied to clipboard
Fix SimplePitchingSplit error: Add missing age and caughtstealingpercentage fields
Summary
- Fixes missing
ageandcaughtstealingpercentagefields in SimplePitchingSplit dataclass - Resolves TypeError when MLB API returns these new fields in pitcher statistics
- Addresses issue #232
Changes Made
- Added
age: Optional[int] = Noneto SimplePitchingSplit - Added
caughtstealingpercentage: Optional[str] = Noneto SimplePitchingSplit - Updated docstring to document the new age field
Testing
- Verified fix works with player ID 641793 (consistently reproduced the issue)
- No breaking changes to existing functionality
- All new fields are optional to maintain backward compatibility
Background
The MLB API has added new statistical fields to pitcher data responses. The existing SimplePitchingSplit dataclass was missing these fields, causing crashes when processing current API responses.
🤖 Generated with Claude Code