Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaHegde committed Jan 15, 2025
1 parent 896490e commit 152b243
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions runtime/queries/timeseries_interval.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ func (q *RollupInterval) Resolve(ctx context.Context, rt *runtime.Runtime, insta
return err
}

if !ctr.Result.Min.IsValid() {
q.Result = &runtimev1.ColumnRollupIntervalResponse{}
return nil
}
duration := ctr.Result.Max.AsTime().Sub(ctr.Result.Min.AsTime())
hours := duration.Hours()
days := int64(0)
Expand Down
8 changes: 4 additions & 4 deletions runtime/resolvers/testdata/metrics_comparisons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ tests:
sort:
- name: sum
result:
- sum: 2
sum_prev: 7
- sum: 7
sum_prev: 2
country: "US"
- name: iso_ranges_clickhouse
resolver: metrics
Expand All @@ -190,6 +190,6 @@ tests:
sort:
- name: sum
result:
- sum: 2
sum_prev: 7
- sum: 7
sum_prev: 2
country: "US"
2 changes: 1 addition & 1 deletion runtime/server/queries_timeseries_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/rilldata/rill/runtime/server"
"github.com/rilldata/rill/runtime/testruntime"
"github.com/stretchr/testify/require"
structpb "google.golang.org/protobuf/types/known/structpb"
"google.golang.org/protobuf/types/known/structpb"
)

func TestServer_Timeseries_EmptyModel(t *testing.T) {
Expand Down

0 comments on commit 152b243

Please sign in to comment.