Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom date range searches in Fangraphs #346

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

erin2722
Copy link
Contributor

This change addresses #293 by adding in start_date and end_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:

  • The user still is required to enter in the start_season parameter-- we could have deduced this from start_date, but I thought it would not be a good idea to make start_season not required.
  • If start_date or end_date doesn't matching the year of start_season or end_season, then an error is thrown, rather than fixing that mistake for the user. If end_season is not entered, then it is deduced from end_date.
  • In the fangraphs UI, if we query for a range longer than 3 years, it returns data for end_date - 3 years until end_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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant