fix(parameters): add NBA Cup and IST season type constants (#620)#625
fix(parameters): add NBA Cup and IST season type constants (#620)#625parthashirolkar wants to merge 1 commit intoswar:masterfrom
Conversation
Resolves swar#620 - Add nba_cup = "NBA Cup" to SeasonType base class - Add ist = "IST" to SeasonType base class - Update all season type tests to validate new constants - Constants inherited by SeasonTypePlayoffs, SeasonTypeAllStar, SeasonTypeNullable, and SeasonTypeAllStarNullable classes Users can now use SeasonTypeAllStar.nba_cup or SeasonTypeAllStar.ist instead of raw string literals.
|
awesome, this makes sense. could you please provide URLs here so we can prove that these parameters are valid? It'll make it easier to verify on here and for us to play around with. I see no problems with this MR other than just confirming the new values. |
|
@swar, thank you so much for spending the time to review! Just so I understand you correctly, do you mean URLs as in the constructed API calls to nba.com 's API that use this filter? |
|
@parthashirolkar Yes that's correct. Basically with these MRs it would be helpful to have a quick URL for reviewers to confirm the new parameters exist. I'll be sure to add this to the contributions documentation that we have as well. |
|
@swar Here are some that demonstrate the SeasonType parameters work on NBA.com:
Hope this is what you were looking for! 😃 |
Summary
nba_cupandistconstants toSeasonTypeparameter classIssue
Fixes #620
Background
Users reported that 'IST' season type works with PlayerGameLogs but not TeamDashLineups. The underlying issue was that these season types (NBA Cup/IST) were not available as named constants in the library, forcing users to use raw string literals.
Changes
src/nba_api/stats/library/parameters.py: Added two new attributes toSeasonTypebase classnba_cup = "NBA Cup"ist = "IST"tests/unit/test_parameters.py: Updated 6 test functions to assert new attributes exist and have correct valuesTesting
Usage Example