Skip to content

making range aggregation untagged union #2725

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

Merged
merged 5 commits into from
Mar 27, 2025
Merged

Conversation

l-trotta
Copy link
Contributor

@l-trotta l-trotta commented Jul 16, 2024

fixes #2641
draft for now because I still have to figure out if we're mapping the responses right

@l-trotta l-trotta marked this pull request as draft July 16, 2024 16:11
@@ -610,6 +610,7 @@ export default async function validateModel (apiModel: model.Model, restSpec: Ma
} else if (variants.kind === 'untagged') {
if (fqn(parentName) !== '_types.query_dsl:DecayFunction' &&
fqn(parentName) !== '_types.query_dsl:DistanceFeatureQuery' &&
fqn(parentName) !== '_types.aggregations:AggregationRange' &&
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Let's keep the names in alphabetical order please :-)

export type AggregationRange =
| UntypedAggregationRange
| NumberAggregationRange
| StringAggregationRange
Copy link
Member

Choose a reason for hiding this comment

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

Let's check, if we can have "term" range aggregations and if yes, rename this variant to TermAggregationRange.

We as well most likely want to have either a Date- or even a DateMath variant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DateRangeAggregation can be part of the union yes. so untyped | number | term | date, like range query?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just noticed that DateRangeAggregation, like IpRangeAggregation, has its own field in the AggregationContainer (date_range). does it make sense to also add it here?

@l-trotta l-trotta marked this pull request as ready for review July 18, 2024 14:42
Copy link
Member

@flobernd flobernd left a comment

Choose a reason for hiding this comment

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

LGTM!

@l-trotta l-trotta force-pushed the range-aggregation-fix branch from 985e70b to 5b89c6e Compare March 27, 2025 14:51
@l-trotta l-trotta requested a review from a team as a code owner March 27, 2025 14:51
@l-trotta l-trotta merged commit 231aa47 into main Mar 27, 2025
11 of 12 checks passed
@l-trotta l-trotta deleted the range-aggregation-fix branch March 27, 2025 15:27
github-actions bot pushed a commit that referenced this pull request Mar 27, 2025
* making range aggregation untagged union

* same as range query

* removed term range aggregation

* Revert "removed term range aggregation"

This reverts commit 1f832ef.

* rebase fix

(cherry picked from commit 231aa47)
l-trotta added a commit that referenced this pull request Mar 27, 2025
* making range aggregation untagged union

* same as range query

* removed term range aggregation

* Revert "removed term range aggregation"

This reverts commit 1f832ef.

* rebase fix

(cherry picked from commit 231aa47)

Co-authored-by: Laura Trotta <[email protected]>
github-actions bot pushed a commit that referenced this pull request Apr 9, 2025
l-trotta added a commit that referenced this pull request Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression on AggregationRange - incorrect types for from and to fields
3 participants