python-mlb-statsapi icon indicating copy to clipboard operation
python-mlb-statsapi copied to clipboard

Fix SimplePitchingSplit error: Add missing age and caughtstealingpercentage fields

Open coreylane opened this issue 5 months ago • 0 comments

Summary

  • Fixes missing age and caughtstealingpercentage fields in SimplePitchingSplit dataclass
  • Resolves TypeError when MLB API returns these new fields in pitcher statistics
  • Addresses issue #232

Changes Made

  • Added age: Optional[int] = None to SimplePitchingSplit
  • Added caughtstealingpercentage: Optional[str] = None to 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

coreylane avatar Aug 29 '25 22:08 coreylane