pybaseball icon indicating copy to clipboard operation
pybaseball copied to clipboard

statcast_batter() function signature does not match usage, player_id shouldn't be marked optional

Open nicholson2208 opened this issue 2 years ago • 0 comments

The Issue

In particular, the function signature has the player_id as an optional argument -- see here

In the actual usage of this function, not supplying a player_id raises ValueError: Player ID is required. Note that the docs make it clear that this is a required parameter, just not the actual function signature.

The Fix

Change the function signature in pybaseball/statcast_batter() from player_id: Optional[int] = None to player_id: int = None

nicholson2208 avatar May 19 '23 22:05 nicholson2208