From 5ca21867d9c89c29d6cfcc665300b916801f892c Mon Sep 17 00:00:00 2001 From: Etienne Perot Date: Thu, 5 Dec 2024 16:57:51 -0800 Subject: [PATCH] tools/bigquery: Skip results upload if there are no results. (Diffbased) PiperOrigin-RevId: 703297420 --- tools/bigquery/bigquery.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/bigquery/bigquery.go b/tools/bigquery/bigquery.go index 7e6c42b7e..21ffb71bf 100644 --- a/tools/bigquery/bigquery.go +++ b/tools/bigquery/bigquery.go @@ -330,6 +330,9 @@ func NewSuite(name string, official bool) *Suite { // SendBenchmarks sends the slice of benchmarks to the BigQuery dataset/table. func SendBenchmarks(ctx context.Context, suite *Suite, projectID, datasetID, tableID string, opts []option.ClientOption) error { + if len(suite.Benchmarks) == 0 { + return nil // Nothing to upload. + } client, err := bq.NewClient(ctx, projectID, opts...) if err != nil { return fmt.Errorf("failed to initialize client on project: %s: %v", projectID, err)