From 03d19a457693cda8112d706bcdbbca7a4f0da372 Mon Sep 17 00:00:00 2001 From: "alex.lew" Date: Wed, 17 Jan 2024 19:31:20 +0000 Subject: [PATCH] fix: update flattenAndSetQuery interface --- observe/resource_dataset.go | 6 +----- observe/resource_monitor.go | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/observe/resource_dataset.go b/observe/resource_dataset.go index 17b20f6e..9dc18ae7 100644 --- a/observe/resource_dataset.go +++ b/observe/resource_dataset.go @@ -248,11 +248,7 @@ func datasetToResourceData(d *gql.Dataset, data *schema.ResourceData) (diags dia } if d.Transform != nil && d.Transform.Current != nil { - stages := make([]*gql.StageQuery, 0) - for _, stage := range d.Transform.Current.Query.Stages { - stages = append(stages, &stage) - } - _, err := flattenAndSetQuery(data, stages, d.Transform.Current.Query.OutputStage) + _, err := flattenAndSetQuery(data, d.Transform.Current.Query.Stages, d.Transform.Current.Query.OutputStage) if err != nil { diags = append(diags, diag.FromErr(err)...) } diff --git a/observe/resource_monitor.go b/observe/resource_monitor.go index 8c8ecbfd..2b6687d8 100644 --- a/observe/resource_monitor.go +++ b/observe/resource_monitor.go @@ -819,11 +819,7 @@ func resourceMonitorRead(ctx context.Context, data *schema.ResourceData, meta in diags = append(diags, diag.FromErr(err)...) } - stages := make([]*gql.StageQuery, 0) - for _, stage := range monitor.Query.Stages { - stages = append(stages, &stage) - } - stageIds, err := flattenAndSetQuery(data, stages, monitor.Query.OutputStage) + stageIds, err := flattenAndSetQuery(data, monitor.Query.Stages, monitor.Query.OutputStage) if err != nil { diags = append(diags, diag.FromErr(err)...) }