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

Fix query timeout #124

Merged
merged 3 commits into from
Jun 3, 2023
Merged

Fix query timeout #124

merged 3 commits into from
Jun 3, 2023

Conversation

ptpaterson
Copy link
Contributor

Ticket(s): BT-3938

Problem

  • we set x-timeout-ms instead of x-query-timeout-ms
  • we send the header as a float, e.g. 5000.0 instead of 5000

Solution

Update the header and header encoding.

Result

Query timeouts are enforced correctly.

Testing

Added a test thatQueryTimeoutErrors get raised when queries run beyond the specified query_timeout configuration.
Added a test for Client.paginate that uses query timeouts to demonstrate that options are getting passed down to requests.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ptpaterson ptpaterson requested review from cynicaljoy and pnwpedro June 2, 2023 19:49
fauna/client/headers.py Outdated Show resolved Hide resolved
@ptpaterson
Copy link
Contributor Author

oops didn't mean to make a draft.

@ptpaterson ptpaterson marked this pull request as ready for review June 2, 2023 19:54
@ptpaterson ptpaterson requested a review from pnwpedro June 2, 2023 19:54
@ptpaterson ptpaterson merged commit acb4241 into main Jun 3, 2023
@ptpaterson ptpaterson deleted the fix-query-timeout branch June 3, 2023 11: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.

2 participants