From de6e27e2627ffd4282a8fa0df59dc6acc68b9aa5 Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 09:06:18 -0500 Subject: [PATCH] [v10.0.x] Transformations: Fix partitionByValues when there is no match (#73048) Transformations: Fix partitionByValues when there is no match (#72981) (cherry picked from commit 8d79d45972d96cf92becd82f0ef7a3b18327d557) Co-authored-by: Ludovic Viaud --- .../transformers/partitionByValues/partitionByValues.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/app/features/transformers/partitionByValues/partitionByValues.ts b/public/app/features/transformers/partitionByValues/partitionByValues.ts index 1e81bca60f0..df7a4ecfddf 100644 --- a/public/app/features/transformers/partitionByValues/partitionByValues.ts +++ b/public/app/features/transformers/partitionByValues/partitionByValues.ts @@ -98,6 +98,11 @@ export function partitionByValues( options?: PartitionByValuesTransformerOptions ): DataFrame[] { const keyFields = frame.fields.filter((f) => matcher(f, frame, [frame]))!; + + if (!keyFields.length) { + return [frame]; + } + const keyFieldsVals = keyFields.map((f) => f.values); const names = keyFields.map((f) => f.name);