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

Refactor some runners to set transport level options #1705

Merged
merged 1 commit into from
Apr 19, 2023

Conversation

b-deam
Copy link
Member

@b-deam b-deam commented Apr 18, 2023

With this commit we fix a bug that prevented any runner using the low
level perform_request() ES client method, and _transport_request_params()
helper method from passing in the request-timeout parameter.

Relates #1673
Relates elastic/rally-tracks#393

Note that there's still follow up work to be done to refactor the remaining runners, specifically around overriding the client's options() method to handle the distribution_version param to support REST compatibility headers as discussed in #1673, but that will only affect us when 9.x is released.

@b-deam b-deam added the bug Something's wrong label Apr 18, 2023
@b-deam b-deam requested review from pquentin and dliappis April 18, 2023 03:09
@b-deam b-deam self-assigned this Apr 18, 2023
@b-deam b-deam added this to the 2.8.0 milestone Apr 18, 2023
Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good to me.

Copy link
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

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

LGTM from me too, thanks for the quick turnaround.

if (ignore_status := request_params.pop("ignore", None)) or (ignore_status := params.pop("ignore", None)):
transport_params["ignore_status"] = ignore_status

headers = params.pop("headers", None) or {}
Copy link
Contributor

Choose a reason for hiding this comment

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

For my own curiosity: there is a possibility that the headers key exists but is not a dict, hence we need to do the or {} instead of just params.pop("headers", {})?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something's wrong
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants