Skip to content

[7.x] [APM]: Inferred types for aggregations (#37360)#39148

Merged
dgieselaar merged 1 commit intoelastic:7.xfrom
dgieselaar:backport/7.x/pr-37360
Jun 18, 2019
Merged

[7.x] [APM]: Inferred types for aggregations (#37360)#39148
dgieselaar merged 1 commit intoelastic:7.xfrom
dgieselaar:backport/7.x/pr-37360

Conversation

@dgieselaar
Copy link
Copy Markdown
Contributor

Backports the following commits to 7.x:

* [APM]: Inferred types for aggregations

Previously, aggregations returned by the ESClient were 'any' by default, and the return type had to be explicitly defined by the consumer to get any type safety. This leads to both type duplication and errors because of wrong assumptions.

This change infers the aggregation return type from the parameters passed to ESClient.search.

* Fix idx error

* Safeguard against querying against non-existing indices in functional tests

* Improve metric typings

* Automatically infer params from function arguments

* Remove unnecessary type hints
@dgieselaar dgieselaar added the backport This PR is a backport of another PR label Jun 18, 2019
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@dgieselaar
Copy link
Copy Markdown
Contributor Author

retest

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@dgieselaar dgieselaar merged commit d3853ee into elastic:7.x Jun 18, 2019
@dgieselaar dgieselaar deleted the backport/7.x/pr-37360 branch June 18, 2019 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants