Add support for custom date range searches in Fangraphs #346
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change addresses #293 by adding in
start_date
andend_date
querying options to the Fangraphs functions.I didn't change any existing functionality in the Fangraphs function, but did make a few design choices when adding this in:
start_season
parameter-- we could have deduced this fromstart_date
, but I thought it would not be a good idea to makestart_season
not required.start_date
orend_date
doesn't matching the year ofstart_season
orend_season
, then an error is thrown, rather than fixing that mistake for the user. Ifend_season
is not entered, then it is deduced fromend_date
.end_date
- 3 years untilend_date
. But I thought it would be better to throw an error in the event that the user submits a query for longer than 3 years.Also added two new test files for these changes, as well as updated the documentation.