Skip to content

Fix elasticsearch tests#697

Merged
basepi merged 5 commits into
elastic:masterfrom
basepi:client_test_fixes
Jan 23, 2020
Merged

Fix elasticsearch tests#697
basepi merged 5 commits into
elastic:masterfrom
basepi:client_test_fixes

Conversation

@basepi

@basepi basepi commented Jan 23, 2020

Copy link
Copy Markdown
Contributor

What does this pull request do?

Fixes elasticsearch tests (failing as of the release of 7.5.1), and removes some brittleness around argument ordering, since that API is dynamically generated and order is not guaranteed.

Also removed our extensive matrix tracking the position of the body argument. elasticsearch-py actually doesn't support non-kwarg use of the API, they are only args because there's no way in py2 to have a required kwarg. Made a note in the docs and updated the tests to match.

elasticsearch-py recommends only using kwargs due to the potential
for positional args to change order. There's no need for us to maintain
an exhaustive matrix for order of arguments when it's an unsupported
use-case upstream.

@bmorelli25 bmorelli25 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

docs lgtm

@basepi

basepi commented Jan 23, 2020

Copy link
Copy Markdown
Contributor Author

@beniwohli I'd prefer to have a review on this since it makes some executive decisions, but I want to get the tests green so I'm going to merge it.

When you're back next week, I would still appreciate a review of this, and can make any changes you recommend at that point.

@basepi basepi merged commit bcc05db into elastic:master Jan 23, 2020
@beniwohli

Copy link
Copy Markdown
Contributor

@basepi I had a cursory look earlier today, looks good! I'll have another look tomorrow

@beniwohli beniwohli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just a couple of doc nitpicks :)

Comment thread CHANGELOG.asciidoc
* Django 1.8, 1.9 and 1.10
* Flask < 1.0

In addition, as of this release we no longer support positional args for

@beniwohli beniwohli Jan 27, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wondering if we should tone down this a little bit, it sounds like things would break if the user uses positional args.

Something like

In addition, as of this release we only supported capturing extended information on elasticsearch queries when using keyword arguments with the elasticsearch-py API. This is in keeping with the
https://elasticsearch-py.readthedocs.io/en/master/api.html#api-documentation[upstream policy]
of positional arguments being unsupported. {pull}697[#697]

* the query string (if available)
* the `query` element from the request body (if available)

We recommend using keyword args only with elasticsearch-py, as recommended by

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
We recommend using keyword args only with elasticsearch-py, as recommended by
We recommend using keyword arguments only with elasticsearch-py, as recommended by

basepi added a commit to basepi/apm-agent-python that referenced this pull request Jan 27, 2020
basepi added a commit that referenced this pull request Jan 28, 2020
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.

3 participants