Skip to content

Conversation

@hiiprtv
Copy link

@hiiprtv hiiprtv commented Nov 20, 2025

This PR adds the missing leaguedashplayerclutch endpoint, which is required for comprehensive clutch stats analysis.

Key changes:

  • Adds the leaguedashplayerclutch.py file to src/nba_api/stats/endpoints/.
  • Includes the necessary specific parameters (ClutchTime, AheadBehind, PointDiff).
  • Adds a corresponding unit test file (test_leaguedashplayerclutch.py).

The endpoint was tested locally and confirmed to retrieve data successfully.

This PR adds the missing leaguedashplayerclutch endpoint.
- Follows the structure of other leaguedash endpoints.
- Adds specific clutch parameters (ClutchTime, AheadBehind, PointDiff).
Fixes CI failure by including the required JSON response file (fixture) to allow unit testing without hitting the live NBA API.
@hiiprtv
Copy link
Author

hiiprtv commented Nov 21, 2025

Hello,

I've added the new leaguedashplayerclutch endpoint, along with the required JSON fixture file to enable stable unit testing.

The CI tests are currently failing due to a consistent ReadTimeoutError on an external test (test_endpoint_uses_global_session) which appears to be hitting the live NBA API and timing out (read timeout=30).

The failing test is related to an existing endpoint (AllTimeLeadersGrids), not my new code. All files related to leaguedashplayerclutch (endpoint, test, and fixture) have been included.

Thanks for the review!

@swar
Copy link
Owner

swar commented Jan 9, 2026

Unless I am missing something, I don't see an endpoint here - only tests. Is that accurate?

@brandonhawi
Copy link
Contributor

Hey @swar , the endpoint actually already exists in master here, which is why it doesn't show up in the diff. This PR is essentially adding the missing tests and JSON fixtures for it (Maybe the PR title should be different?) Regardless, locally the tests pass but since this is hitting a live endpoint it makes sense we're seeing errors in CI.

@hiiprtv, what are your thoughts on all this?

@hiiprtv
Copy link
Author

hiiprtv commented Jan 14, 2026

Hello @swar and @brandonhawi ,

That is correct. I realized while working on this that the endpoint file already existed in master, but it was missing the associated unit tests and the static JSON fixture required for CI stability. My goal with this PR was to provide that missing test coverage and the fixture so that the endpoint is fully supported by the library's testing suite and doesn't rely on live API calls during CI.I have updated the PR title to better reflect this.

Regarding the failing checks, they appear to be consistent ReadTimeoutErrors hitting the live API on existing tests, rather than issues with these new files.

@hiiprtv hiiprtv changed the title FEAT: Add leaguedashplayerclutch endpoint FEAT: Add unit tests and JSON fixture for leaguedashplayerclutch Jan 14, 2026
@hiiprtv hiiprtv closed this Jan 17, 2026
@hiiprtv hiiprtv deleted the add-leaguedashplayerclutch branch January 17, 2026 07:34
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.

3 participants