-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add hard_bounds for histograms #5098
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
Conversation
|
Those tests are the correct place to add them but they are breaking the integration assertions: This might warrant their own You can run just a particular test with:
|
|
@Mpdreamz I've reworked the tests, adding specific ones as you suggested. These seem to pass locally now too using |
tests/Tests/Aggregations/Bucket/DateHistogram/DateHistogramAggregationUsageTests.cs
Outdated
Show resolved
Hide resolved
tests/Tests/Aggregations/Bucket/DateHistogram/DateHistogramAggregationUsageTests.cs
Outdated
Show resolved
Hide resolved
As with extended_bounds, we should append the date_optional_time format to the format starting on the aggregation. This avoids parsing errors on the server. Includes an update the documentation.
|
@Mpdreamz / @russcam - On further review I noticed that this was already handled for extended_bounds by adding date_optional_time to the format string. I've updated the code so we apply the same here and now formatting works as expected. One thing I did notice is that the callout from https://github.com/elastic/elasticsearch-net/blob/master/tests/Tests/Aggregations/Bucket/DateHistogram/DateHistogramAggregationUsageTests.cs#L42 is not rendered into the final documentation - https://github.com/elastic/elasticsearch-net/blob/master/docs/aggregations/bucket/date-histogram/date-histogram-aggregation-usage.asciidoc Is there something extra needed to make that work? It's affecting the current 7.x documentation. https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/date-histogram-aggregation-usage.html |
| get => !string.IsNullOrEmpty(_format) && | ||
| !_format.Contains("date_optional_time") && | ||
| (ExtendedBounds != null || Missing.HasValue) | ||
| (ExtendedBounds != null || HardBounds != null || Missing.HasValue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ this hack comes back to me now 😄
* Add hard_bounds for histograms * Apply date_optional_time format for hard_bounds * Add new hard_bounds tests As with extended_bounds, we append the date_optional_time format to the format starting on the aggregation. This avoids parsing errors on the server. Includes an update to the documentation which we be generated and added in a subsequent PR.
* Add hard_bounds for histograms * Apply date_optional_time format for hard_bounds * Add new hard_bounds tests As with extended_bounds, we append the date_optional_time format to the format starting on the aggregation. This avoids parsing errors on the server. Includes an update to the documentation which we be generated and added in a subsequent PR.
* Add hard_bounds for histograms * Apply date_optional_time format for hard_bounds * Add new hard_bounds tests As with extended_bounds, we append the date_optional_time format to the format starting on the aggregation. This avoids parsing errors on the server. Includes an update to the documentation which we be generated and added in a subsequent PR. Co-authored-by: Steve Gordon <[email protected]>
* Add hard_bounds for histograms * Apply date_optional_time format for hard_bounds * Add new hard_bounds tests As with extended_bounds, we append the date_optional_time format to the format starting on the aggregation. This avoids parsing errors on the server. Includes an update to the documentation which we be generated and added in a subsequent PR. Co-authored-by: Steve Gordon <[email protected]>
Please consider this a WIP for review to check I'm on the best track.
Adds hard_bounds parameter to histogram aggregations per elastic/elasticsearch#59175.
Questions:
For now, I've made
HardBoundsa copy ofExtendedBounds. I suspect we can't safely rename this public type to something more general. An option would be to define the properties in a base class from which these two could derive. Perhaps overkill here though.I've updated two usage tests to confirm that the final JSON is built as expected. Are there any further tests we should be considering on additional such as this one?