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 issue caused by 7.x breaking change (_source_include/_source_exclude) #1019

Merged
merged 1 commit into from
Sep 26, 2019

Conversation

XD-DENG
Copy link
Contributor

@XD-DENG XD-DENG commented Sep 20, 2019

In documentation, _source_exclude/_source_include are still listed as parameters of a few methods (e.g. https://elasticsearch-py.readthedocs.io/en/master/api.html?highlight=get#elasticsearch.Elasticsearch.get ), while _source_excludes/_source_includes are not mentioned at all.

However, Elasticsearch 7.x ONLY accepts _source_excludes/_source_includes. _source_exclude/_source_include will cause exception on Elasticsearch 7.x. Hence, when I tried to follow the API documentation, I encountered error like the one below.

RequestError(400,
'illegal_argument_exception',
{'error': 
{'root_cause':
[
{'reason':
   'request [/xxxxxx] contains unrecognized parameter: [_source_exclude] -> 
   did you mean any of [_source_excludes, _source_includes]?',
   'type': 'illegal_argument_exception'}], 
   'type': 'illegal_argument_exception',
   'reason': 'request [/xxx] contains unrecognized parameter: [_source_exclude] ->
   did you mean any of [_source_excludes, _source_includes]?'},
   'status': 400}
)

Given recommended client version is quite clear (https://github.com/elastic/elasticsearch-py#compatibility), the solution can be simply replace all _source_exclude/_source_include with _source_excludes/_source_includes.

Reference:

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

Copy link
Contributor

@philkra philkra left a comment

Choose a reason for hiding this comment

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

LGTM

@philkra
Copy link
Contributor

philkra commented Sep 26, 2019

Jenkins test this please

@philkra philkra merged commit 9421f36 into elastic:master Sep 26, 2019
@philkra
Copy link
Contributor

philkra commented Sep 26, 2019

@XD-DENG , thank you for your contribution

@XD-DENG XD-DENG deleted the patch-2 branch September 26, 2019 13:58
@XD-DENG
Copy link
Contributor Author

XD-DENG commented Sep 26, 2019

Thanks @philkra for merging this.

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