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

404 error for Edmonton 1990-1991 #84

Closed
B-D-T opened this issue Nov 22, 2024 · 3 comments · Fixed by #87
Closed

404 error for Edmonton 1990-1991 #84

B-D-T opened this issue Nov 22, 2024 · 3 comments · Fixed by #87
Assignees

Comments

@B-D-T
Copy link

B-D-T commented Nov 22, 2024

Describe the bug

The get_season_schedule method returns an error for Edmonton in the 1990-1991 season.

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I believe this is because the NHL's API returns a 404 for that request. In which case, that may be out of scope for fixes to this package.

To Reproduce

Steps to reproduce the behavior:

client = NHLClient(verbose=True)
schedule = Schedule(client._http_client)
schedule.get_season_schedule("EDM", "19901991") # returns error above

Expected behavior

Returns JSON formatted data with Edmonton's games from the 1990-1991 season.

Further details

This is the code for get_season_schedule:

   def get_season_schedule(self, team_abbr: str, season: str) -> dict:
        return self.client.get(resource=f"club-schedule-season/{team_abbr}/{season}").json()

If we run just the .get:

self.client.get(resource=f"club-schedule-season/{team_abbr}/{season}")

it returns

<Response [404 Not Found]

@coreyjs
Copy link
Owner

coreyjs commented Nov 22, 2024

Ill check this out, thanks for opening the ticket!

@coreyjs coreyjs self-assigned this Nov 22, 2024
@coreyjs
Copy link
Owner

coreyjs commented Nov 22, 2024

That's interesting, https://api-web.nhle.com/v1/club-schedule-season/EDM/19901991 returns a 404, but 19891990 and 19911992 work. It seems to be something with their data, but I agree this should not "error", I'll find a good solution for this.

Its also broke on their own site https://www.nhl.com/oilers/schedule/1990/fullseason

@coreyjs coreyjs linked a pull request Nov 22, 2024 that will close this issue
@B-D-T
Copy link
Author

B-D-T commented Nov 23, 2024

Thanks. I sent a note to NHL.com to alert them to root issue.

I'll piece together the data from the opponents' schedules. I was just surprised when I had gameId values with only 1 record.

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 a pull request may close this issue.

2 participants