Transformations: Fix partitionByValues when there is no match (#72981)

This commit is contained in:
Ludovic Viaud
2023-08-08 15:10:31 +02:00
committed by GitHub
parent 1ac9e7eaab
commit 8d79d45972

View File

@@ -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);