-
Notifications
You must be signed in to change notification settings - Fork 19
Improve (date)_range just like filters
#970
Conversation
730be6c to
3f8dabd
Compare
(date)_range just like filters(date)_range just like filters
5e674e7 to
f1064ec
Compare
(date)_range just like filters(date)_range just like filters
Deploying quesma with
|
| Latest commit: |
3b9d891
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a258b9d5.quesma.pages.dev |
| Branch Preview URL: | https://semifix-for-all-combinators.quesma.pages.dev |
| if test.TestName == "Line, Y-axis: Min, Buckets: Date Range, X-Axis: Terms, Split Chart: Date Histogram(file:kibana-visualize/agg_req,nr:9)" { | ||
| t.Skip("Date range is broken, fix in progress (PR #971)") |
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.
Adding a new test that fails. Unskipping another one above/below as this PR fixes it.
| if !isCombinator { | ||
| return | ||
| } | ||
|
|
||
| noMoreBucket := len(pancake.layers) <= 1 || (len(pancake.layers) == 2 && pancake.layers[1].nextBucketAggregation == nil) | ||
| noMetricOnFirstLayer := len(firstLayer.currentMetricAggregations) == 0 && len(firstLayer.currentPipelineAggregations) == 0 | ||
| canSimplyAddCombinatorToWhereClause := noMoreBucket && noMetricOnFirstLayer | ||
| if canSimplyAddCombinatorToWhereClause { | ||
| return | ||
| } | ||
|
|
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.
I think code should be a bit clearer now? Feel free to disagree
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.
Though not sure if that's always correct if we count size. Though it might be.
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.
Ok, we add size as metric aggregation, so this should be good.
f068003 to
db2bd9c
Compare
jakozaur
left a comment
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.
Great work!
| if !isCombinator { | ||
| return | ||
| } | ||
|
|
||
| noMoreBucket := len(pancake.layers) <= 1 || (len(pancake.layers) == 2 && pancake.layers[1].nextBucketAggregation == nil) | ||
| noMetricOnFirstLayer := len(firstLayer.currentMetricAggregations) == 0 && len(firstLayer.currentPipelineAggregations) == 0 | ||
| canSimplyAddCombinatorToWhereClause := noMoreBucket && noMetricOnFirstLayer | ||
| if canSimplyAddCombinatorToWhereClause { | ||
| return | ||
| } | ||
|
|
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.
Though not sure if that's always correct if we count size. Though it might be.
| if !isCombinator { | ||
| return | ||
| } | ||
|
|
||
| noMoreBucket := len(pancake.layers) <= 1 || (len(pancake.layers) == 2 && pancake.layers[1].nextBucketAggregation == nil) | ||
| noMetricOnFirstLayer := len(firstLayer.currentMetricAggregations) == 0 && len(firstLayer.currentPipelineAggregations) == 0 | ||
| canSimplyAddCombinatorToWhereClause := noMoreBucket && noMetricOnFirstLayer | ||
| if canSimplyAddCombinatorToWhereClause { | ||
| return | ||
| } | ||
|
|
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.
Ok, we add size as metric aggregation, so this should be good.
Don't get dissuaded by the nr of changed lines, there's almost nothing happening here.
(Date)_rangeandfiltersare basically the same aggregation. I recently improvedfiltersa bit, but didn't do anything to(date)_range.This PR makes all those combinators work in the same way, so there are two issues left - #971 (easier) and #944 (a bit harder). Afterwards they will all fully work.