Skip to content
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

Merged
merged 5 commits into from
Nov 21, 2024
Merged

Conversation

trzysiek
Copy link
Member

@trzysiek trzysiek commented Nov 11, 2024

Don't get dissuaded by the nr of changed lines, there's almost nothing happening here.

(Date)_range and filters are basically the same aggregation. I recently improved filters 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.

@trzysiek trzysiek force-pushed the semifix-for-all-combinators branch from 730be6c to 3f8dabd Compare November 12, 2024 08:16
@trzysiek trzysiek changed the title Improve (date)_range just like filters [after #971] Improve (date)_range just like filters Nov 12, 2024
@trzysiek trzysiek force-pushed the semifix-for-all-combinators branch from 5e674e7 to f1064ec Compare November 13, 2024 20:07
@trzysiek trzysiek changed the title [after #971] Improve (date)_range just like filters Improve (date)_range just like filters Nov 13, 2024
Copy link

cloudflare-workers-and-pages bot commented Nov 13, 2024

Deploying quesma with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3b9d891
Status: ✅  Deploy successful!
Preview URL: https://a258b9d5.quesma.pages.dev
Branch Preview URL: https://semifix-for-all-combinators.quesma.pages.dev

View logs

@trzysiek trzysiek marked this pull request as ready for review November 13, 2024 20:16
@trzysiek trzysiek requested a review from a team as a code owner November 13, 2024 20:16
@trzysiek trzysiek enabled auto-merge November 13, 2024 20:16
Comment on lines +56 to +59
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)")
Copy link
Member Author

@trzysiek trzysiek Nov 13, 2024

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.

Comment on lines +433 to 443
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
}

Copy link
Member Author

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

Copy link
Contributor

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.

Copy link
Contributor

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.

@trzysiek trzysiek force-pushed the semifix-for-all-combinators branch from f068003 to db2bd9c Compare November 15, 2024 14:45
Copy link
Contributor

@jakozaur jakozaur left a comment

Choose a reason for hiding this comment

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

Great work!

Comment on lines +433 to 443
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
}

Copy link
Contributor

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.

Comment on lines +433 to 443
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
}

Copy link
Contributor

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.

@trzysiek trzysiek added this pull request to the merge queue Nov 21, 2024
Merged via the queue into main with commit 2e78116 Nov 21, 2024
5 checks passed
@trzysiek trzysiek deleted the semifix-for-all-combinators branch November 21, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants