-
Notifications
You must be signed in to change notification settings - Fork 6
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
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 Cloudflare Pages
|
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
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)_range
andfilters
are basically the same aggregation. I recently improvedfilters
a 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.