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

[BUG] Parameters in get_league do not affect output #18

Open
1 task done
rbarman opened this issue Apr 27, 2024 · 2 comments
Open
1 task done

[BUG] Parameters in get_league do not affect output #18

rbarman opened this issue Apr 27, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@rbarman
Copy link

rbarman commented Apr 27, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The parameters in get_league do not affect the output.

All of the below calls return the same output. It returns all of the league's information. Changing the tab parameter does not do anything.

league_id = 47 # premier league
res = client.get_league(league_id )
matches_res = client.get_league(league_id ,tab='matches')
table_res = client.get_league(league_id, tab=' table')
# Changing the tab parameter does not change the output. Tried with all of the documented tab options (overview, table, matches, stats, transfers)

# confirm it returns same data
assert res == matches_res
assert res == table_res
assert matches_res == table_res

Expected Behavior

If we specify a parameter, then the output should return data only for that parameter.

client.get_league(league_id ,tab='matches') should only return data about the league's matches.

Steps To Reproduce

main.py

league_id = 47 # premier league
res = client.get_league(league_id )
matches_res = client.get_league(league_id ,tab='matches')
table_res = client.get_league(league_id, tab=' table')
# Changing the tab parameter does not change the output. Tried with all of the documented tab options (overview, table, matches, stats, transfers)

# confirm it returns same data
assert res == matches_res
assert res == table_res
assert matches_res == table_res

Steps:

python -m venv venv
.\venv\Scripts\activate
python main.py

Environment

- OS: Windows 11
- Python: 3.11.4
- pip: 23.1.2

Version

1.0.0

Anything else?

The root cause might be incorrect way of applying the tab parameter in the API url

get_league internally builds urls like these:

These urls all return the same data.

@rbarman rbarman added the bug Something isn't working label Apr 27, 2024
@bgrnwd
Copy link
Owner

bgrnwd commented May 2, 2024

Hey @rbarman thanks for submitting this bug. I will try to re-create it and get back to you.

@bgrnwd
Copy link
Owner

bgrnwd commented May 25, 2024

I was able to replicate this locally. My hunch is the API may have changed at some point. I'll push a fix in the next couple weeks.

@bgrnwd bgrnwd self-assigned this May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants