-
-
Notifications
You must be signed in to change notification settings - Fork 271
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
Expanding Ergast filter parameters #489
Conversation
Testing fork
…d final endpoint val
Hi, thanks for noting this problem and opening this PR. I do see some issues with the approach that you have chosen to fix this, though. First, given that multiple selectors can be combined, I suggest instead that the drivers endpoint is implemented similarly to, for example, the laps endpoint. In fact, the drivers, constructors, circuits and status endpoint need to be implemented in this way. Do you want to update your PR? Please also adhere to the PEP8 style guidelines. |
…tatus, driver, constructors, and circuit
I've updated the commit on this. I see what you're suggesting this behavior is already in place for a few endpoints, such as lap. I mimicked the behavior over into the recommended endpoints you provided. This allowed us to completely remove |
After reinvestigating the failure it seems that there is some complexity to wrap my head around.
Theoretically I need to further mimic the |
Yes, exactly. The API endpoint structure is not very consistent. |
Noting saw docs with amend future commits Is this a breaking change, considering the changes alter the data from ergast? I've altered the calls to replicate the function you shared.
Don't think I got this part perfected. I need to use something alternative besides selector length. |
No, the current behaviour is incorrect, therefore this is a bug fix. I'll have a look at everything and do some manual testing, and then I'll get back to you. |
I pushed some minor changes to your branch and added more tests. Everything looks good now. Thank you for noticing this issue and for helping to fix it. |
The
_build_url
function leads to an error by adding an additional parameter "endpoint" to the end of the filename for every case. Which leads toErgastInvalidRequestError
The warning can be found here:
"Only some combinations of filter parameters are possible and those vary for each API endpoint. FastF1 does not impose restrictions on these combinations as the relationships are fairly complex. Instead, an ErgastInvalidRequestError will be returned in such a case. The exception will contain the error response of the server."
Expected: https://ergast.com/api/f1/2023/drivers/alonso.json
Received: https://ergast.com/api/f1/2023/drivers/alonso/drivers.json
This endpoint needs to be present if no filters are applied or if only season or round filters are used. If any additional filter params are present, we omit the endpoint param, returning a valid URL