Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 67befce

Browse files
author
trzysiek
committed
Cleanup
1 parent baa8be3 commit 67befce

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

platform/parsers/elastic_query_dsl/pancake_aggregation_parser_buckets.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ func (cw *ClickhouseQueryTranslator) parseDateHistogram(aggregation *pancakeAggr
115115
if missingRaw, exists := params["missing"]; exists {
116116
if missing, ok := missingRaw.(string); ok {
117117
dateManager := NewDateManager(cw.Ctx)
118-
if funcName, missingExpr := dateManager.ParseDateUsualFormat(missing, colRef); missingExpr != nil {
119-
field = model.NewFunction("COALESCE", field, model.NewFunction(funcName, missingExpr))
118+
if missingExpr := dateManager.ParseDateUsualFormat(missing, colRef); missingExpr != nil {
119+
field = model.NewFunction("COALESCE", field, missingExpr)
120120
weAddedMissing = true
121121
} else {
122122
logger.ErrorWithCtx(cw.Ctx).Msgf("unknown format of missing in date_histogram: %v. Skipping it.", missing)
@@ -142,7 +142,8 @@ func (cw *ClickhouseQueryTranslator) parseDateHistogram(aggregation *pancakeAggr
142142
interval, intervalType := cw.extractInterval(params)
143143
// TODO GetDateTimeTypeFromExpr can be moved and it should take cw.Schema as an argument
144144

145-
dateHistogram := bucket_aggregations.NewDateHistogram(cw.Ctx, field, colRef, interval, timezone, format, minDocCount, ebMin, ebMax, intervalType)
145+
dateHistogram := bucket_aggregations.NewDateHistogram(cw.Ctx,
146+
field, colRef, interval, timezone, format, minDocCount, ebMin, ebMax, intervalType)
146147
aggregation.queryType = dateHistogram
147148

148149
columnSql := dateHistogram.GenerateSQL()

platform/parsers/elastic_query_dsl/pancake_sql_query_generation_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ func TestPancakeQueryGeneration(t *testing.T) {
6363
t.Skip("works IRL, need to update test's schema. It's already WIP https://github.com/QuesmaOrg/quesma/pull/1255. Let's wait for merge.")
6464
}
6565

66-
if i != 217 {
67-
// t.Skip()
68-
}
69-
7066
if filters(test.TestName) {
7167
t.Skip("Fix filters")
7268
}
@@ -92,10 +88,12 @@ func TestPancakeQueryGeneration(t *testing.T) {
9288
assert.NoError(t, err)
9389

9490
pancakeSqls, err := cw.PancakeParseAggregationJson(jsonp, false)
91+
assert.NoError(t, err)
9592
for j, pancake := range pancakeSqls {
96-
pancakeSqls[j], _ = transformations_delete.ApplyNecessaryTransformations(context.Background(), pancake, &table, currentSchema)
93+
pancakeSqls[j], err = transformations_delete.ApplyNecessaryTransformations(context.Background(), pancake, &table, currentSchema)
94+
assert.NoError(t, err)
9795
}
98-
assert.NoError(t, err)
96+
9997
assert.True(t, len(pancakeSqls) >= 1, "pancakeSqls should have at least one query")
10098
if len(pancakeSqls) < 1 {
10199
return

0 commit comments

Comments
 (0)