[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 8d79d45972)

Co-authored-by: Ludovic Viaud <ludovic.viaud@gmail.com>
This commit is contained in:
grafana-delivery-bot[bot]
2023-09-19 09:06:18 -05:00
committed by GitHub
co-authored by Ludovic Viaud
parent b37468701f
commit de6e27e262
@@ -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);