jldbc / pybaseball

Pull current and historical baseball statistics using Python (Statcast, Baseball Reference, FanGraphs)
MIT License
1.19k stars 324 forks source link

Bug fix for `statcast_batter` #256

Closed akern40 closed 2 years ago

akern40 commented 2 years ago

statcast_batter asserts that its parameters are not None, but does not reassign the parameters after the call to sanitize_input, leading to failure when end_dt is left as None. This commit reassigns the inputs from sanitize_input. player_id is not reassigned to avoid typing errors, since sanitize_input turns it into a string but split_request still expects an integer. Closes #255

schorrm commented 2 years ago

Looks great, can you add a test case to catch this?

akern40 commented 2 years ago

@schorrm just added a commit that tests whether optional start and end dates autofill as expected.