-
Notifications
You must be signed in to change notification settings - Fork 226
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
Basketball add expected return date to player #630
Basketball add expected return date to player #630
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #630 +/- ##
==========================================
+ Coverage 82.71% 82.73% +0.01%
==========================================
Files 61 61
Lines 2326 2328 +2
==========================================
+ Hits 1924 1926 +2
Misses 402 402 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit, but looks good!
espn_api/basketball/player.py
Outdated
@@ -18,6 +18,8 @@ def __init__(self, data, year, pro_team_schedule = None): | |||
self.posRank = json_parsing(data, 'positionalRanking') | |||
self.stats = {} | |||
self.schedule = {} | |||
expected_return_date = json_parsing(data, 'expectedReturnDate') | |||
self.expectedReturnDate = datetime(*expected_return_date).date() if expected_return_date else None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can set this var name to expected_return_date
, to follow better python standard. It was my bad habit of following the API name vars in the beginning of creating this package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed, thanks for the review!
Just need to resolve conflict and I can merge it in! |
Resolved, thanks! |
Small commit to add expected return date (from injury) to the player class. It returns a datetime date.
Example:
league.player_info(name="Jalen Johnson").expectedReturnDate)
Return:
2025-01-30
Alternatively if you prefer to keep it simple we could do it in one line:
self.expectedReturnDate = json_parsing(data, 'expectedReturnDate')
And then the same code returns:
[2025, 1, 30]
Just thought it might be nice to return in datetime format but I'm good with it either way.