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

Ergast - results final position filter #494

Merged
merged 12 commits into from
Dec 28, 2023
Merged

Ergast - results final position filter #494

merged 12 commits into from
Dec 28, 2023

Conversation

Lombardoc4
Copy link
Contributor

Expanding standings_position from Driver & Constructor Standings to Race, Qualifying, & Sprint results.

Changes for get_race_results(), get_qualifying_results(), get_sprint_results()

  • Adding the parameter standings_position the same as it is done for get_driver_standings() and get_constructor_standings(). This name does not accurately describe the value. However the var is pre-existing and exhibits the same behavior as needed.

Changes for building the url:

  • Use the standings_position as the final selector when building the url.

Ergast documentation to support

Driver Standings:
All winners of the driver or constructor championships can be obtained using:
https://ergast.com/api/f1/driverStandings/1
https://ergast.com/api/f1/constructorStandings/1

Race:
So to list all drivers and constructors winning races in a season:
https://ergast.com/api/f1/2008/results/1

Qualifying:
If you are only interested in qualifying results with a specific finishing position you can add a qualifier:
https://ergast.com/api/f1/2008/qualifying/1

Sprint
If you are only interested in results for a specific finishing position you can add a qualifier:
https://ergast.com/api/f1/2021/sprint/1

Note this is a fresh version of interface.py omitting changes from other PRs

@theOehrly
Copy link
Owner

Something went wrong here I think? +1460 lines does not seem right. I think you accidentally duplicated a bunch of code?

@Lombardoc4
Copy link
Contributor Author

My fault, I wanted to start fresher, without the changes from my other PR. Got a bit sloppy with the initial branch setup, should be all clean now.

Copy link
Owner

@theOehrly theOehrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment about the stadnings position being appended at the end of the API path needs to be addressed.

Also, this PR should be rebased onto master again.

@theOehrly theOehrly merged commit 1b6a823 into theOehrly:master Dec 28, 2023
8 checks passed
@Lombardoc4 Lombardoc4 deleted the results-position-filter branch December 29, 2023 16:44
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.

2 participants