Skip to content

Conversation

@parthashirolkar
Copy link

@parthashirolkar parthashirolkar commented Jan 8, 2026

Summary

  • Add nba_cup and ist constants to SeasonType parameter class
  • Both values resolve to "NBA Cup" and "IST" respectively
  • Inherited by all season type parameter classes
  • Updated unit tests to validate new constants

Issue

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 to SeasonType base class
    • nba_cup = "NBA Cup"
    • ist = "IST"
  • tests/unit/test_parameters.py: Updated 6 test functions to assert new attributes exist and have correct values

Testing

  • All 460 unit tests pass
  • Verified constants work with TeamDashLineups and PlayerGameLogs
  • Tested both constant values and direct string values (backward compatible)

Usage Example

from nba_api.stats.endpoints import TeamDashLineups
from nba_api.stats.library.parameters import SeasonTypeAllStar

endpoint = TeamDashLineups(
    team_id=1610612739,
    season="2024-25",
    season_type_all_star=SeasonTypeAllStar.nba_cup,
    get_request=True
)

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.
@swar
Copy link
Owner

swar commented Jan 9, 2026

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.

@parthashirolkar
Copy link
Author

@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?

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.

[Bug]: season_type_all_star value for TeamDashLineups, 'IST' isn't working this season

2 participants