From c3880829524e3fcc0e300defaff97a2fabf7497a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ida=20=C5=A0tambuk?= Date: Fri, 20 Oct 2023 00:31:24 +0200 Subject: [PATCH] Fix PR comments --- pkg/framer/property_value.go | 4 +- .../test/property_value_aggregate_test.go | 2 - ...n-with-disassociated-stream-A.golden.jsonc | 142 ++++++++++++++++-- 3 files changed, 132 insertions(+), 16 deletions(-) diff --git a/pkg/framer/property_value.go b/pkg/framer/property_value.go index 3628b634..6d2daffb 100644 --- a/pkg/framer/property_value.go +++ b/pkg/framer/property_value.go @@ -19,9 +19,9 @@ func (p AssetPropertyValue) Frames(ctx context.Context, resources resource.Resou if err != nil { return nil, err } - var property *iotsitewise.DescribeAssetPropertyOutput + for _, e := range p.SuccessEntries { - property = properties[*e.EntryId] + property := properties[*e.EntryId] timeField := fields.TimeField(0) valueField := fields.PropertyValueField(property, 0) qualityField := fields.QualityField(0) diff --git a/pkg/server/test/property_value_aggregate_test.go b/pkg/server/test/property_value_aggregate_test.go index ca98bf20..438f0dd8 100644 --- a/pkg/server/test/property_value_aggregate_test.go +++ b/pkg/server/test/property_value_aggregate_test.go @@ -27,7 +27,6 @@ type test struct { name string query string isExpression bool - isDisassociated bool expectedMaxPages int expectedMaxResults int expectedDescribeTimeSeriesWithContextArgs *iotsitewise.DescribeTimeSeriesInput @@ -209,7 +208,6 @@ func TestPropertyValueAggregateWithDisassociatedStream(t *testing.T) { expectedDescribeTimeSeriesWithContextArgs: &iotsitewise.DescribeTimeSeriesInput{Alias: Pointer("/amazon/renton/1/rpm")}, expectedMaxPages: 1, expectedMaxResults: 0, - isDisassociated: true, } t.Run(tc.name, func(t *testing.T) { diff --git a/pkg/testdata/property-history-values-from-alias-boolean-with-disassociated-stream-A.golden.jsonc b/pkg/testdata/property-history-values-from-alias-boolean-with-disassociated-stream-A.golden.jsonc index 32d200ba..98a42f318 100644 --- a/pkg/testdata/property-history-values-from-alias-boolean-with-disassociated-stream-A.golden.jsonc +++ b/pkg/testdata/property-history-values-from-alias-boolean-with-disassociated-stream-A.golden.jsonc @@ -10,13 +10,23 @@ // } // } // Name: -// Dimensions: 3 Fields by 0 Rows -// +-------------------+----------------------------+----------------+ -// | Name: time | Name: /amazon/renton/1/rpm | Name: quality | -// | Labels: | Labels: | Labels: | -// | Type: []time.Time | Type: []float64 | Type: []string | -// +-------------------+----------------------------+----------------+ -// +-------------------+----------------------------+----------------+ +// Dimensions: 3 Fields by 35 Rows +// +-------------------------------+----------------------------+----------------+ +// | Name: time | Name: /amazon/renton/1/rpm | Name: quality | +// | Labels: | Labels: | Labels: | +// | Type: []time.Time | Type: []bool | Type: []string | +// +-------------------------------+----------------------------+----------------+ +// | 2021-02-01 17:30:00 +0100 CET | true | GOOD | +// | 2021-02-01 17:35:00 +0100 CET | true | GOOD | +// | 2021-02-01 17:40:00 +0100 CET | false | GOOD | +// | 2021-02-01 17:45:00 +0100 CET | false | GOOD | +// | 2021-02-01 17:50:00 +0100 CET | true | GOOD | +// | 2021-02-01 17:55:00 +0100 CET | true | GOOD | +// | 2021-02-01 18:00:00 +0100 CET | false | GOOD | +// | 2021-02-01 18:05:00 +0100 CET | false | GOOD | +// | 2021-02-01 18:10:00 +0100 CET | true | GOOD | +// | ... | ... | ... | +// +-------------------------------+----------------------------+----------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -44,9 +54,9 @@ }, { "name": "/amazon/renton/1/rpm", - "type": "number", + "type": "boolean", "typeInfo": { - "frame": "float64" + "frame": "bool" }, "config": {} }, @@ -61,9 +71,117 @@ }, "data": { "values": [ - [], - [], - [] + [ + 1612197000000, + 1612197300000, + 1612197600000, + 1612197900000, + 1612198200000, + 1612198500000, + 1612198800000, + 1612199100000, + 1612199400000, + 1612199700000, + 1612200000000, + 1612200300000, + 1612200600000, + 1612200900000, + 1612201200000, + 1612201500000, + 1612201800000, + 1612202100000, + 1612202400000, + 1612202700000, + 1612203000000, + 1612203300000, + 1612203600000, + 1612203900000, + 1612204200000, + 1612204500000, + 1612204800000, + 1612205100000, + 1612205400000, + 1612205700000, + 1612206000000, + 1612206300000, + 1612206600000, + 1612206900000, + 1612207200000 + ], + [ + true, + true, + false, + false, + true, + true, + false, + false, + true, + true, + false, + false, + true, + true, + false, + false, + true, + true, + false, + false, + true, + true, + false, + false, + true, + true, + false, + false, + true, + true, + false, + false, + true, + true, + false + ], + [ + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD", + "GOOD" + ] ] } }